Here I got my first batch of acronyms : SCB,SCTB,SWAD,SWCR,CRISTAL,etc. In addition to the acronyms I got tons of documents but none very promising.
Ok I got a line CMS Software and Computing Reviews:perhaps from here I can learn where I have to look.I'll check it later.
There is also a CMS Object-oriented page
and a neat list of projects. So I learn that in CMS the reconstruction program is named
ORCA,
and the Montecarlo is OSCAR.
IGUANA(Interactive Graphical User Analysis)
looks promising, but what
is SCRAM(Software Configuration Release and Management)?
The other stuff (CRISTAL,FAMOS,TRIDAS,etc..) seems not to be relevant for my purpose.
In the ORCA main page I find an item about training with many tutorials: this looks promising. And also an orca users mailing list .
Well, after an hour I haven't still solved my problem but I have found a lot of material.Perhaps I will need more than 10 minutes!
cmspf01::/cms/reconstruction/user/jet0900/jet0900.bootNow log on cms.cern.ch and add the following lines at the end of your .login file
setenv OBJY_VERS 5.2.1 setenv OO_FD_BOOT cmspf01::/cms/reconstruction/user/jet0900/jet0900.boot if (-r /afs/cern.ch/rd45/objectivity/objyenv.csh) then source /afs/cern.ch/rd45/objectivity/objyenv.csh endifNow you can run ootoolmgr with the command:
ootoolmgrWhen the graphic window appears, you just select in "File" the "default..." line, then "Browse FD" in the "Tools" menu'. You should see the following window. In this window you can browse all databases, containers and objects in the federation. You have only to select which one you want and they will show up in the appropriate window. At last, this is the theory.In fact the program is very slooow. Let me guess it: my federation must be very BIG with data coming from many computers.
oo TAB. Out of all these commands we use oodumpcatalog to get this nice list of the federation content. 5069 files! But they seem to be almost all on the same computer(in fact this computer will only redirect access requests to the computer that really contains the file:this will create a lot of problems if the file becomes for some reason unreadable).
ooschemadump. The result is this list of classes (A class is a definition of a kind of objects). The schema itself can be seen here.
cd /tmp mkdir $USER cd $USER scram project ORCA ORCA_4_3_0 cd ORCA_4_3_0/src eval `scram runtime -csh` cmscvsroot ORCA cvs login (enter 98passwd) cvs co -r current Workspace cd Workspace touch ExRunEventInfo.cc scram b shared_debug scram b bin_debug_local rehash source myenv.csh ExRunEvent > temp.lis &This is the result of my first trial.
| Spell | Result of the spell | Things to be carefull about before you cast it |
| Click on Cern Computer Resources | to have information on computers, disk space and other resources available in Cern | |
scram list | List of all public projects and their releases | You get also the main directory of the release. By looking at .SCRAM/Linux__2.2/ after this directory, you have a list of all packages needed by the project. |
scram project ORCA ORCA_4_3_0 | Create your own private project starting from the public release indicated. | Requires lot of disk space! |
scram tool list | Lists all tools available in SCRAM | The command must be done in the directories of a private project |
scram tool info toolname | Lists all information about a given tool | ditto |
source /afs/cern.ch/rd45/objectivity/objyenv.csh | Makes Objectivity software accessible | |
eval `scram runtime -csh` | Makes all the libraries known to SCRAM accessible | |
scram runtime -csh | Prints the result of the previous command without executing it | use -sh if you use sh like shell |
cd $ORCA_DATA_DIR cd .. ls | List of Orca packages | |
scram build | The equivalent of make for SCRAM.Executes the Buildfile contained in the directory where you are. | Every Buildfile uses other Build files (Command use) which use other Buildfiles,etc
The command builds an executable (Command bin) and/or libraries (command lib).
Give the option echo_INCLUDE to know which directories are searched for include. In a Buildfile put a first line with: INCLUDE+=path/dirto add an arbitrary directory to search for Include Files. |
scram b shared | Like the previous command, but will build only shared libraries. | |
scram b bin | Will build only binaries(executables). | |
scram build clean | To undo the effect of previous scram build in your local Release Area | |
scram b help | To know what you can build in your local Release Area. | |
scram b CXXUSERFLAGS=-g | Compile with g flag for debugging | |
ootoolmgr | Starts a graphical tool to explore your federation | Best to define in advance your federation giving the bootfile in the command setenv OO_FD_BOOT bootfile |
oodumpcatalog | List of all files in your federation(the Catalog) | |
| Click here | List of all datasets in the testdata federation | |
rfdir hpsssrv1:/hpss/cern.ch/cms rfdir /castor/cern.ch/cms/reconstruction/datafiles | list of cms federations on hpss and castor( castor is replacing gradually hpss) | Use:
rfdir /castor/cern.ch/cms/reconstruction/datafiles/ORCA_7_3_0 | grep EVD0_Digisto know which datasets are available |
oolockmon bootfile | List all current locks to the federation with given bootfile | |
oocleanup -transaction transid bootfile | Get rid of stale lock transid | Be sure that the lock is truly stale by checking if the process with pid given in the lock list is still running |
oocleanup -local bootfile | get rid of all locks coming from this machine | ditto |
oocheckams computer | Checks if AMS is working on computer:AMS allows local federation databases to be accessed from remote computers. | |
| Click here | List of Orca manuals for all versions. | |
| Click here | To look at the code. | |
| Click here | To look at the code in the CVS repository. | |
| grep raise /afs/cern.ch/cms/Releases/ORCA/ORCA_6_2_3/src/ Visualisation/*/src/*.cc | To find the lines of the code containing some word. | |
| Click here:Cobra release notes, Minutes, ORCA mailing list, ORCA FAQ | Latest news on CMS software. | |
ooschemadump | List of all persistent objects | Best to define in advance your federation giving the bootfile in the command setenv OO_FD_BOOT bootfile |
| Click here | Bootfile and list of datasets for Autumn 2000 production | |
| Click here | Bootfiles and list of datasets for Spring 2000 production | |
| Click here | CMS production main page | |
ls -lR /afs/cern.ch/cms/oo/reconstruction/datafiles | List of sample FZ event files produced by CMSIM | |
iguana | To run iguana | |
env LOG=stderr iguana | To run iguana with detailed debug printout | |
cd /afs/cern.ch/cms/Releases/COBRA/COBRA_7_3_2/src/Visualisation/VisMantis/test iguana | to run Iguana to visualize DDD detector description as implemented in Oscar | Select the Mantis plugin |
cmscvsroot projectname | Define CVS repository for the project so you can access the source | |
cvs --help-commands | List of CVS commands | |
cvs checkout Modulenameor cvs co Modulename | Get a local copy of the module source in your working directory that you can edit | Will get the head version i.e. the most recent version.This can also be a version not working properly. |
cvs co -r version Modulename | To checkout a particular(stable) version of the module | |
cvs diff | To know the differences between what is in the repository and what you have in your directory | |
cvs update -r version | To get your local copy in synch with the repository | This can be necessary when the head version is no more working and you want to go back to some stable previous version. The version tag should be normally of the form ORCA_4_5_0 |
cvs add Modulename | To add a new module to the repository | Only for developers! Must be followed by a cvs ci command
. The file Root in the CVS directory must contain the following line::kserver:cmscvs.cern.ch:/cvs_server/repositories/ORCA |
cvs ci -m "message" Modulename | To update a module in the repository | Only for developers! |
cvs remove Modulename | To remove a module from the repository | Only for developers! |
cvs tag -b release0 | To tag a (stable)version as release0: a new branch is created | Only for developers! |
cvs rtag -b -r release0 release0.1 Modulename | To connect branch release0.1 to branch release0. This can be useful to deal with bugs corrections to a stable version. | Only for developers! |
cvs log Modulename | To list the versions of a module | Without Modulename will work recursively on the directory |
cvs log -N -d ">2002-9-1" | more | To list all revisions done after the specified date | |
cvs diff -r version Modulename | diff with a previous version of a module | |
klog.krb gzito -cell cern.ch cvs -d :kserver:cmscvs.cern.ch:/cvs_server/repositories/IGUANACMS commit -m "message" | to access repository from a node outside Cern |
void ExRunEventInfo::myAnalysis(G3EventProxy * ev) { // Just print the signal event number (see CARF/G3Event/interface/G3EventHeader.h) cout << "===========================================================" << endl; cout << "=== Private analysis of event #"<< ev->simTrigger()->id().eventInRun() << " in run #" << ev->simTrigger()->id().runNumber() << endl; eventsAnalysed++; // some statistics: count events and runs processed // And now the event numbers of all pileup events cout << "--- PileUp events are: " ; G3EventProxy::pu_range PUrange = ev->pileups(); for (G3EventProxy::pu_iterator ipu = PUrange.first; ipu != PUrange.second; ipu++) { PUeventsUsed++; // count them if (ipu != PUrange.first) { cout << ", "; } cout << (*ipu).id().eventInRun(); } cout << endl; if (ev->simTrigger()->id().runNumber() != lastrun) { lastrun = (unsigned int) ev->simTrigger()->id().runNumber(); runsAnalysed++; } cout << "===========================================================" << endl; };At last! So, if ev points to your event, the code to get event number and run number is:
ev->simTrigger()->id().eventInRun() ev->simTrigger()->id().runNumber()The dataset used can be found in the myenv.csh file:
setenv OO_FD_BOOT cmsuf01::/cms/reconstruction/user/muonDIGI0300/muonDIGI0300.boot setenv CARF_INPUT_OWNER muonSignal0300 setenv CARF_INPUT_DATASET_NAME MB1mu_pt1
setenv OO_FD_BOOT cmspf01::/cms/reconstruction/user/jet0900/jet0900.boot setenv CARF_INPUT_OWNER jetNoPU_CERN setenv CARF_INPUT_DATASET_NAME eg_1gam_pt25This is an example of SimHits display for the muon tracks in the DT muon detector with the following dataset:
setenv OO_FD_BOOT cmsuf01::/cms/reconstruction/user/muonDIGI0300/muonDIGI0300.boot setenv CARF_INPUT_OWNER 1034PileupMEInTimeOnly_b setenv CARF_INPUT_DATASET_NAME tt2mu
This is instead the result using a new better release described in this presentation and in this new tutorial
cd ORCA_5_1_2/src cmscvsroot ORCA cvs co Visualisation cd Visualisation/OrcaVis/test eval `scram runtime -csh` scram build bin (you can avoid this since a working program is already available) rehash source testfed.csh OrcaVisMain &(Remember that in addition to the buttons and menus, you can click the right mouse button to bring up a menu and experiment with the different draw styles.) This version is a lot better and I can manage to see some nice event pictures:
I did it! I described the edit,compile and run process like a CMS nerd!!!Let's see if I can also get the plot done.
scram project ORCA ORCA_4_3_0 cd ORCA_4_3_0/src eval `scram runtime -csh` cmscvsroot ORCA cvs co -r v430_Tutorial1 Examples/Tutorial cd Examples/Tutorial scram build shared scram build bin eval `scram runtime -csh dbreading.env` rehash ExTutNtuple > temp.lis &Unfortunately I got only the following error message:
** Error #2111: new(Anyhow, let's look at the various files used: Since now I am getting smart, I note that the error is in the database, so I try again using myenv.csh of the recipe for the impatient user. So instead of) ooDBObj(): Object Manager: The Federated Database is only open for read access
eval `scram runtime -csh dbreading.env`I do a
source myenv.csc. Bad luck. I got the following error:
checkRunSelector: warning DB 5585 for EventsToken not closed
checkRunSelector: warning DB 5585 for EventsToken still locked
** Error #906: ooHandle(ooObj)::open(): The object handle is not valid
- context = #?-?-?-?
Segmentation fault (core dumped)
with the following output listing.
setenv OO_FD_BOOT cmspf01::/cms/reconstruction/user/jet0900/jet0900.boot setenv CARF_INPUT_OWNER jetNoPU_CERN setenv CARF_INPUT_DATASET_NAME eg_1gam_pt25getting the following listing. The program actually filled a ntuple with 10 events.You can see here the result of nt/print command and of nt/list command.
oolockmon bootfilewill list all current locks to the federation that has the bootfile indicated in the command. For example this was the result of the command:
oolockmon cmspf01::/cms/reconstruction/user/jet0900/jet0900.bootrun during the execution of the Ntuple example on cms008. When the command was issued , the program was accessing 5 files with DBID 65535,1,8250,10478,80251. So, if you give this command from time to time during the execution of a ORCA program, you can follow all the activity connected to database access.
oocleanup -transaction transid bootfileThe transaction number transid is taken from the previos list. Instead
oocleanup -local bootfilewill clean all locks coming from the computer where you are running.
scram project ORCA ORCA_4_4_0 cd ORCA_4_4_0/src eval `scram runtime -csh` cmscvsroot ORCA cvs co Examples/ExCalorimetry cd Examples/ExCalorimetry scram b shared scram b bin rehash setenv OO_FD_BOOT cmspf01::/cms/reconstruction/user/jet0900/jet0900.boot setenv CARF_INPUT_OWNER jetNoPU_CERN setenv CARF_INPUT_DATASET_NAME eg_1gam_pt25 ExClusterHistograms
PKBuilder<ExClusterInfo> mybuilder("ExClusterInfoBuilder");
registers the class "ExClusterInfo" as observer of some event(i.e. to be called
when that event will happen). Which event? This can be seen in the first line
of the class "ExClusterInfo".
class ExClusterInfo : private ActiveObserver<G3EventProxy *> {
The event is "G3EventProxy" i.e. start processing of a new Montecarlo event.
How can I pass the last event data to my code (in this case the "method"
myAnalysis)? When the event occurs, ORCA will call the method "update" (that
I must code) passing a pointer to the last event. What I do is pass along the
event to my subroutine/method: this can be seen in the code
void upDate(G3EventProxy * ev) { if (ev!=0) myAnalysis(ev);}
// And now the event numbers of all pileup events
cout << "--- PileUp events are: " ;
G3EventProxy::pu_range PUrange = ev->pileups();
for (G3EventProxy::pu_iterator ipu = PUrange.first; ipu != PUrange.second; ipu++) {
PUeventsUsed++; // count them
if (ipu != PUrange.first) {
cout << ", ";
}
cout << (*ipu).id().eventInRun();
}
cout << endl;
RecItr<EcalPlusHcalTower> MyCaloTower(ev->recEvent());
/* Print Run and Event number and fill them to our Ntuple */
cout << "Run #" << ev->simTrigger()->id().runNumber() << "; ";
cout << "Event #" << ev->simTrigger()->id().eventInRun() << endl;
UserNtuples->FillGeneral(ev->simTrigger()->id().runNumber(),ev->simTrigger()->id().eventInRun());
float Ecalo=0.0; // for the total calorimetric energy
float Eecaltotal=0.0;
float Ehcaltotal=0.0;
HepPoint3D TowerPosition;
/* Loop over all CaloCluster objects */
while (MyCaloTower.next()) {
Ecalo += MyCaloTower->Energy(); // sum up the total energy
Eecaltotal+=MyCaloTower->EnergyEcalTower(); // sum up the Ecal energy
Ehcaltotal+=MyCaloTower->EnergyHcalTower(); // sum up the Hcal energy
TowerPosition = MyCaloTower->Position();
/* Print energy, azimuth and pseudo-rapidity of a cluster and fill this
* to our Ntuple */
cout.setf(ios::showpoint);
cout << "New Tower E(tot/Ecal/Hcal)=" << setw(8) << setprecision(3)
<< MyCaloTower->Energy() << "/"
<< MyCaloTower->EnergyEcalTower() << "/"
<< MyCaloTower->EnergyHcalTower() << " GeV"
<< "; phi=" << setw(8) << setprecision(4) << TowerPosition.phi() << " rad"
<< "; eta=" << TowerPosition.pseudoRapidity()
<< endl;
UserNtuples->AddTower(MyCaloTower->Energy(),TowerPosition.phi(),
TowerPosition.pseudoRapidity());
}
RecItr<CaloCluster> MyCluster(ev->recEvent(),"EcalFixedWindow_5x5");
// Just print the event number (see CARF/G3Event/interface/G3EventHeader.h)
cout << "===========================================================" << endl;
cout << "=== Private analysis of event #"<< ev->simTrigger()->id().eventInRun()
<< " in run #" << ev->simTrigger()->id().runNumber() << endl;
eventsAnalysed++; // some statistics: count events and runs processed
if (ev->simTrigger()->id().runNumber() != lastrun) {
lastrun = (unsigned int) ev->simTrigger()->id().runNumber();
runsAnalysed++;
}
// Here is the loop over all clusters
while (MyCluster.next()) {
nClusters++; // count the clusters
// Print some of the cluster properties
// see Calorimetry/CaloCommon/interface/CaloCluster.h
cout << "Cluster " << nClusters <<": E=" << MyCluster->Energy()
<< ", eta="<< MyCluster->Eta()
<< ", phi="<< MyCluster->Phi() << endl;
// Fill them to (our) histograms. Defined in ExClusterHistos.h
UserHists->FillEepCluster(MyCluster->Energy(), MyCluster->Eta(),
MyCluster->Phi());
}
while (iterator.next()){ }
in the last two cases. In the first case(list of pileup events) it is slightly more complex:
for(iterator=firstitem;iterator!=lastitem;iterator++){ }
In any case the iterator inside the loop points to the current object and
we can use it to get all information about the object.
RecItr<objectname> ip(ev->RecEvent())and the variable ip will point to the first object of the type indicated for the event indicated.This is a reconstructed object and a Reconstruction on Demand similar to the Action on Demand of the previous section is performed in this case in the following way: if the requested RecObj is not present in the data base ,it is computed on the fly by the "default" module used for the object. In the case 3 you see that it is also possible to select a RecObj computed by a module indicated by us (EcalFixedWindow_5x5). In this way we can test new reconstruction algorithms.
EVD0_Events.eg_1gam_pt25.jetNoPU_CERN EVD0_Digis.eg_1gam_pt25.jetNoPU_CERN EVD0_Collections.eg_1gam_pt25.jetNoPU_CERNThe other 9 have the same name but starting with EVD1 EVD2 EVD3.
EVD0_Collections.eg_1gam_pt25.jetHit120_2D_CERN EVD0_Events.eg_1gam_pt25.jetHit120_2D_CERN EVD0_Hits.eg_1gam_pt25.jetHit120_2D_CERN EVD0_MCInfo.eg_1gam_pt25.jetHit120_2D_CERN EVD0_THits.eg_1gam_pt25.jetHit120_2D_CERNalso these repeated with EVD1,EVD2,EVD3 with a total of other 20 files.
eg_1gam_pt25 jetHit120_2D_CERN Collections 0 1 2 3 eg_1gam_pt25 jetHit120_2D_CERN Events 0 1 2 3 eg_1gam_pt25 jetHit120_2D_CERN Hits 0 1 2 3 eg_1gam_pt25 jetHit120_2D_CERN MCInfo 0 1 2 3 eg_1gam_pt25 jetHit120_2D_CERN THits 0 1 2 3 eg_1gam_pt25 jetNoPU_CERN Collections 0 1 2 3 eg_1gam_pt25 jetNoPU_CERN Digis 0 1 2 3 eg_1gam_pt25 jetNoPU_CERN Events 0 1 2 3So event 1 Run 37 must be tracked in these 32 Objectivity databases! The first group of files contains the objects connected to SimTrigger; the second those pointed from RecEvent.
<environment> <lib name=Workspace><lib> <Group name=RecReader> <External ref=COBRA Use=CARF> <bin file=ExRunEvent.cpp>my favourite application</bin> </environment>This is the smallest set that will work. Note that all external libraries are loaded using the BuildFile in COBRA/CARF.This BuildFile uses the tag RecReader to select the classes needed to read RecHits. SimHits are read by the libraries loaded with the tag SimReader.
where ExRunEventthen search in the
bin directory given and in the nearby lib directory.
<environment> <lib name=Workspace><lib> <Use name=Tracker> <Group name=RecReader> <External ref=COBRA Use=CARF> <bin file=ExRunEvent.cpp>my favourite application</bin> </environment>We have only added a card saying to Scram that the BuildFile of the subsystem Tracker must be used.
<environment> <lib name=Tutorial> <lib name=EcalPlusHcalTower> <lib name=CaloCluster> <Group name=CaloRecHitReader> <Use name=Calorimetry> <Group name=RecReader> <External ref=COBRA Use=CARF> <External ref=root> <bin file=ExTutNtuple.cpp></bin> </environment>The main change here , is that we request the use of the BuilFile in the subsystem Calorimetry.This BuildFile will load many different sets of libraries and the set that we want is selected by the tag CaloRecHitReader. Note that in addition to these libraries, we request explicitily the libraries of subsystem Calorimetry EcalPlusHcalTower and CaloCluster.
<External ref=cern> <External ref=cmsim> <External ref=HepODBMS> <External ref=Objectivity> <lib name=ExCalorimetry> <environment> <Group name=CaloHitReader> <Group name=CaloRHitWriter> <Group name=CaloRHitReader> <lib name=EcalFixedWindow> <lib name=CaloData> <lib name=CaloCluster> <Use name=Calorimetry> <Group name=RecReader> <Use name=CARF> <Use name=Utilities> <bin file=ExClusterHistograms.cpp></bin> </Use> </Use> </Use> </lib> </environment> <environment> <Group name=CaloHitReader> <Group name=CaloRHitWriter> <Group name=CaloRHitReader> <lib name=EcalFixedWindow> <lib name=EcalDynamical> <lib name=CaloData> <lib name=CaloCluster> <Use name=Calorimetry> <Group name=RecReader> <Use name=CARF> <Use name=Utilities> <bin file=ExCompClusterers.cpp></bin> </Use> </Use> </Use> </lib> </environment> </External> </External> </External> </External>
| external ref=productname | libraries,include files and other stuff connected to the external product |
| lib name=libname | libraries found in the SCRAM search path. |
| Use name=package | the package indicated.In fact this means a reference to the Buildfile of the package. |
| Group name=groupname | The group will set a switch that will control the loading of used packages. What really happens depends on the BuildFile of the package. |
scram project ORCA ORCA_4_5_0 cd ORCA_4_5_0/src eval `scram runtime -csh` cmscvsroot ORCA cvs co Examples/CompGenRec cd Examples/CompGenRec scram b setenv OO_FD_BOOT cmspf01::/cms/reconstruction/user/jet0900/jet0900.boot setenv CARF_INPUT_OWNER jetNoPU_CERN setenv CARF_INPUT_DATASET_NAME eg_1gam_pt25 rehash ExCompMuonLet's look at the result: This example is interesting since the program will access generated muons, calorimeter clusters, tracker tracks and muon detector tracks through four methods(subroutines) called getGeneratorParticles, getCalorimeterClusters, getTrackerTracks, getMuonTracks. As you can see from the code the access to each kind of information is far for simple and the BuildFile itself is also complex. No wonder that we can't get a simple program filling some quantity in a histogram running:the navigation to access any single piece of information that before was as easy as counting 1,2,.. in a bank, now is a complete nightmare.
creating a ROU Slave Factory for:followed by some acronym. This is connected to the mechanism seen before. The first two letters in the acronym indicate wich kind of subdetector ORCA is handling:
The release 5_1_2 of ORCA has a new way to define the input dataset:I would like to have information on this: here are my tries:InputCollections=instead ofCARF_INPUT_OWNER= CARF_INPUT_DATASET_NAME=
In addition the data to read from this federation has to be specified in a .orcarc file in the local directory.
MaxEvents = 10 InputCollections = /System/SimHits/single_mu_pt50/single_mu_pt50This example specifies (to an ORCA SimReader application) to use the dataset single_mu_pt50 with the owner name SimHits. The dataset name specifies normally the kind of events (here single muons with 50 GeV transvers momentum) and has to be repeated. The owner name indicates how the events have been treated. Here for example it is just the simulated hits. Other examples are NoPileup or Lumi1034 for data that has been digitised for no pileup or for pileup corresponding to a luminosity of ...
#ifndef TwigMuBarRpcRecHits_H
#define TwigMuBarRpcRecHits_H
#include <Inventor/SbString.h>
#include "Cmscan/IgCmscan/interface/IgQtTwig.h"
#include <fstream>
/**
*
* Draw the reconstructed hits in the muon RPC (barrel)
*
*
*/
class TwigMuBarRpcRecHits : public IgQtTwig
{
public:
typedef IgQtTwig inherited;
explicit TwigMuBarRpcRecHits( IgQtTwig* parent, SbString nm, bool b = true,
bool c = false )
: IgQtTwig( parent, nm, b, c ) { outfile= new ofstream("out.dat",ios::ou
t);}
~TwigMuBarRpcRecHits() { outfile->close();}
/** Draw the reconstructed hits in the muon system.
*/
void drawMe();
protected:
//! Provide basic information upon pick
virtual void printInfo( ostream & ostr, const SoNode* node ) const;
private:
ostream* ostr;
ofstream* outfile;
};
#endif
TwigMuBarRpcRecHits.cc is obtained from TwigEndRpcRecHits.cc
#include "Utilities/Configuration/interface/Architecture.h"
#undef HEP_SHORT_NAMES
#include "Visualisation/MuonVis/interface/TwigMuBarRpcRecHits.h"
#include <iostream>
#include "HEPVis/nodes/SoHitsKit.h"
#include "Muon/MRpcDetector/interface/MRpcDetector.h"
#include "Muon/MRpcDetector/interface/MRpcChamber.h"
#include "Muon/MRpcDetector/interface/MRpcDetUnit.h"
#include "Muon/MRpcSetUp/interface/MRpcSetUp.h"
#include "Muon/MRpcDetector/interface/CMSMuonRpc.h"
#include "CommonDet/DetLayout/interface/DetLayer.h"
#include "CommonDet/BasicDet/interface/RecHit.h"
#include "Utilities/Notification/interface/Singleton.h"
#include <Inventor/nodes/SoMaterial.h>
void TwigMuBarRpcRecHits::drawMe()
{
{
// Count up total number of RecHit's
// ---------------------------------
int nRecHits = 0;
MRpcSetUp* muon_setup = Singleton::instance();
CMSMuonRpc * muon = muon_setup->CMSMRpc();
for( int ilay = 0; ilay<4; ilay++ ) {
DetLayer* layer = muon->barrelLayers()[ilay];
for( int ista = 0; ista< layer->detUnits().size(); ista++ ) {
DetUnit* stat = layer->detUnits()[ ista ];
DetUnit::RecHitContainer sits = stat->recHits();
for( DetUnit::RecHitIterator is = sits.begin(); is != sits.end(); is++ )
{
LocalPoint xyzLocal = is->localPosition();
float x = xyzLocal.x();
float y = xyzLocal.y();
float z = xyzLocal.z();
float dx = is->localPositionError().xx();
float dy = is->localPositionError().yy();
nRecHits++;
*outfile << nRecHits << " "<< ilay <<" " << ista << " " << x << " " << y << " " << z << " " << dx << " " << dy << endl;
}
}
}
cout << "Number of Rpc Rechits: " << nRecHits << endl;
}
void TwigMuBarRpcRecHits::printInfo( ostream & ostr, const SoNode* node ) const
{
}
This is the modified Init.cc
#include "Utilities/Configuration/interface/Architecture.h" #include "Visualisation/MuonVis/interface/TwigMuBarSimHits.h" #include "Visualisation/MuonVis/interface/TwigMuBarRpcRecHits.h" #include "Visualisation/MuonVis/interface/TwigMuBarSegment.h" #include "Visualisation/MuonVis/interface/TwigMuEndSimHits.h" #include "Visualisation/MuonVis/interface/TwigMuEndRecHits.h" #include "Visualisation/MuonVis/interface/TwigMuEndSegment.h" #include "Visualisation/MuonVis/interface/TwigMuEndRpcSimHits.h" #include "Visualisation/MuonVis/interface/TwigMuBarRpcSimHits.h" #include "Visualisation/MuonVis/interface/TwigMuSimTracks.h" #include "Visualisation/MuonVis/interface/TwigMuRecTracks.h" #include "Visualisation/OrcaVis/interface/TwigEvt.h" #include "Utilities/Notification/interface/Observer.h" class BuildMuonVisEvt : private Observer{ public: BuildMuonVisEvt() { init();} private: void upDate(TwigEvt* theTwigEvt) { if (theTwigEvt==0) return; // Muon System // IgQtTwig * theTwigEvtMuon = new IgQtTwig( theTwigEvt, "Muon System", TRU E, TRUE ); // // Muon Barrel // IgQtTwig * theTwigBarMuon = new IgQtTwig( theTwigEvtMuon, "Muon Barrel", TRUE, TRUE ); (void) new TwigMuBarSimHits( theTwigBarMuon, "DT Sim Hits", FAL SE, FALSE ); (void) new TwigMuBarRpcSimHits( theTwigBarMuon, "RPC Sim Hits", FAL SE, FALSE ); (void) new TwigMuBarRpcRecHits( theTwigBarMuon, "RPC Rec Hits", FAL SE, FALSE ); (void) new TwigMuBarSegment( theTwigBarMuon, "DT Track Segments", FAL SE, FALSE ); // // Muon Endcap // IgQtTwig * theTwigEndMuon = new IgQtTwig( theTwigEvtMuon, "Muon Endcap", TRUE, TRUE ); (void) new TwigMuEndSimHits( theTwigEndMuon, "CSC Sim Hits", FA LSE, FALSE ); (void) new TwigMuEndRpcSimHits( theTwigEndMuon, "RPC Sim Hits", FA LSE, FALSE ); (void) new TwigMuEndRecHits( theTwigEndMuon, "CSC Rec Hits", FA LSE, FALSE ); (void) new TwigMuEndSegment( theTwigEndMuon, "CSC Track Segments", FA LSE, FALSE ); (void) new TwigMuRecTracks( theTwigEvtMuon, "Rec Tracks", FALSE, FA LSE ); (void) new TwigMuSimTracks( theTwigEvtMuon, "Sim Tracks", FALSE, FA LSE ); } }; #include "Utilities/Notification/interface/PackageInitializer.h" static PKBuilder muonVisEvt("MuonVisEvt");
#include "CommonDet/BasicDet/interface/DetType.h"
SbVec3f *pts = new SbVec3f[nSimHits];
SbVec3f *iPts = pts;
cout << "Tracker found " << nSimHits << " SimHits " << endl;
int nde=0;
for (iDet = dets.begin(); iDet != dets.end(); iDet++) {
SimDet* simDet = iDet->simDet();
Module modulo = iDet->type().module();
Part bar_fow = iDet->type().part();
int isd = (int)iDet->type().sides();
if (simDet && !simDet->simHits().empty()) {
const SimDet::SimHitContainer& sits = simDet->simHits();
for (SimDet::SimhitIterator is = sits.begin(); is != sits.end(); is++)
{
float x = is->globalPosition().x() / 100.0; // cm -> m
float y = is->globalPosition().y() / 100.0; // cm -> m
float z = is->globalPosition().z() / 100.0; // cm -> m
*iPts++ = SbVec3f(x,y,z);
nde++;
*outfile << nde <<" "<< modulo << " " << bar_fow << " " << x << " " << y <<
" " << z << " "<< endl;
}
}
}
The result:
1 pixel forward 0.0324629 0.140936 -0.315116 2 pixel forward 0.00167622 0.0964537 -0.324112 3 pixel forward 0.0144903 0.0951627 -0.319427 4 pixel forward 0.0189675 0.0740032 -0.321541 5 pixel forward 0.0330585 0.115285 -0.330074 6 pixel forward 0.0388094 0.105706 -0.33154
#ifndef __INCLUDE_TwigTkRecHits__
#define __INCLUDE_TwigTkRecHits__
#include <Inventor/SbString.h>
#include "Visualisation/OrcaVis/interface/AutoTwig.h"
#include "Ig_Extensions/IgGeant3/interface/G3Pars.h"
#include "CommonDet/BasicDet/interface/DetUnit.h"
#include <Inventor/SbLinear.h>
#include <fstream>
class TwigTkRecHits : public AutoTwig {
public:
typedef IgQtTwig inherited;
explicit TwigTkRecHits(IgQtTwig* parent, SbString nm, bool b=true, bool
c=false) :
AutoTwig(parent, nm, b, c) {
outSimHitF = new ofstream("SimHitF.dat",ios::out);
}
void drawMe();
private:
ofstream* outSimHitF;
};
#endif
Code for TwigTkRecHits.cc
#include "Utilities/Configuration/interface/Architecture.h"
#include "Visualisation/TrackerVis/interface/TwigTkRecHits.h"
#include <iostream>
#include "Tracker/CARFTracker/interface/FullTracker.h"
#include "Tracker/TkLayout/interface/CmsTracker.h"
#include "CommonDet/DetGeometry/interface/GlobalPoint.h"
#include "CommonDet/DetGeometry/interface/TkRotation.h"
#include "CommonDet/DetGeometry/interface/Surface.h"
#include "CommonDet/DetGeometry/interface/ActiveMediaShape.h"
#include "CommonDet/DetLayout/interface/DetLayer.h"
#include "CommonDet/BasicDet/interface/DetUnit.h"
#include "CommonDet/BasicDet/interface/Enumerators.h"
#include "CommonDet/BasicDet/interface/Det.h"
#include "CommonDet/BasicDet/interface/DetType.h"
#include "CommonDet/BasicDet/interface/RecHit.h"
void TwigTkRecHits::drawMe() {
inherited::drawMe();
// instanciate Tracker
const CmsTracker::LayerContainer& theLayerContainer = FullTracker::instance()->Tracker()->forwardLayers();
CmsTracker::layer_p_iter iLay;
int nlay=0;
int nmod1=0;
int anello = 0;
int nmod = 0;
int nsimhit = 0;
float r;
float phi,phi1;
int spicchi[] ={24,24,40,56,40,56,80};
float rmedioS[]={0.27665, 0.3671, 0.4474, 0.5617, 0.6768, 0.8189, 0.9912};
float rmedioP[]={0.064122, 0.0766412, 0.0899707, 0.10658, 0.12008, 0.137039, 0.145999};
for (iLay = theLayerContainer.begin(); iLay != theLayerContainer.end(); iLay++) {
nlay++;
Module layer_type = (*iLay)->module();
const CmsTracker::DetContainer theDetContainer = (*iLay)->detUnits();
CmsTracker::det_p_iter iDet;
for (iDet = theDetContainer.begin() ; iDet != theDetContainer.end() ; iDet++) {
float posx = (*iDet)->surface().position().x()/ 100.0; // cm -> m
float posy = (*iDet)->surface().position().y()/ 100.0; // cm -> m
r=pow((posx*posx + posy*posy),0.5);
phi1=atan(posy/posx);
phi=phi1;
if(posy < 0.&&posx>0)phi=phi1+2.*3.1415;
if(posx < 0.)phi=phi1+3.1415;
if(fabs(posy)<0.000001&&posx>0)phi=0;
if(fabs(posy)<0.000001&&posx<0)phi=3.1415;
if(fabs(posx)<0.000001&&posy>0)phi=3.1415/2.;
if(fabs(posx)<0.000001&&posy<0)phi=3.1415/2.;
if (layer_type==silicon) {
for (int i=0;i<7; i++){
if (fabs(r-rmedioS[i])<0.0001){
anello =i+1;
break;
}
}
nmod=(int)((phi/(2.*3.1415))*spicchi[anello-1]+.1)+1;
}
else{
for (int i=0; i<7; i++){
if(fabs(r -rmedioP[i])<0.0001){
anello=i+1;
break;
}
}
nmod=(int)((phi/(2.*3.1415))*24+.1)+1;
}
Module modulo = (*iDet)->type().module();
Part bar_fow = (*iDet)->type().part();
int isd = (int)(*iDet)->type().sides();
if (!(*iDet)->recHits().empty()) {
DetUnit::RecHitContainer sits = (*iDet)->recHits();
for (DetUnit::RecHitIterator is = sits.begin(); is != sits.end(); is++) {
float posx = is->globalPosition().x() / 100.0; // cm -> m
float posy = is->globalPosition().y() / 100.0; // cm -> m
float posz = is->globalPosition().z() / 100.0; // cm -> m
float x = is->localPosition().x() ;
float y = is->localPosition().y();
float dx = is->localPositionError().xx();
float dy = is->localPositionError().yy();
nsimhit++;
*outSimHitF << nsimhit << " " << (*iLay)->module() <<" "<< "forward"<< " " << nlay <<" "<< anello << " " << nmod << " " << posx << " " << posy << " " << posz << " " << x << " " << y << " "<< dx << " " << dy << endl;
}
}
}
}
const CmsTracker::LayerContainer& theLayerContainer1 = FullTracker::instance()->Tracker()->barrelLayers();
CmsTracker::layer_p_iter iLay1;
nmod1=0;
nmod = 0;
float oldz;
int spicchib[] ={18,30,42,28,38,44,56,42,48,54,60,66,74};
for (iLay1 = theLayerContainer1.begin(); iLay1 != theLayerContainer1.end();
iLay1++) {
nlay++;
anello = -1;
Module layer_type1 = (*iLay1)->module();
const CmsTracker::DetContainer theDetContainer1 = (*iLay1)->detUnits();
CmsTracker::det_p_iter iDet1;
for (iDet1 = theDetContainer1.begin() ; iDet1 != theDetContainer1.end()
; iDet1++) {
float posx = (*iDet1)->surface().position().x()/ 100.0; // cm -> m float posy = (*iDet1)->surface().position().y()/ 100.0; // cm -> m float posz = (*iDet1)->surface().position().z()/ 100.0; // cm -> m if (anello == -1){
oldz = posz;
anello = 1;
}
else{
if(fabs(oldz - posz) > 0.001 )
{
oldz = posz;
anello++;
}
}
r=pow((posx*posx + posy*posy),0.5);
phi1=atan(posy/posx);
phi=phi1;
if(posy < 0.&&posx>0)phi=phi1+2.*3.1415;
if(posx < 0.)phi=phi1+3.1415;
if(fabs(posy)<0.000001&&posx>0)phi=0;
if(fabs(posy)<0.000001&&posx<0)phi=3.1415;
if(fabs(posx)<0.000001&&posy>0)phi=3.1415/2.;
if(fabs(posx)<0.000001&&posy<0)phi=3.1415/2.;
nmod=(int)((phi/(2.*3.1415))*spicchib[nlay-29]+.1)+1;
Module modulo1 = (*iDet1)->type().module();
Part bar_fow1 = (*iDet1)->type().part();
int isd1 = (int)(*iDet1)->type().sides();
if (!(*iDet1)->recHits().empty()) {
DetUnit::RecHitContainer sits1 = (*iDet1)->recHits();
for (DetUnit::RecHitIterator is1 = sits1.begin(); is1 != sits1.end(); is1++) {
float posx1 = is1->globalPosition().x() / 100.0; // cm -> m float posy1 = is1->globalPosition().y() / 100.0; // cm -> m float posz1 = is1->globalPosition().z() / 100.0; // cm -> m float x1 = is1->localPosition().x() ;
float y1 = is1->localPosition().y();
float dx1 = is1->localPositionError().xx();
float dy1 = is1->localPositionError().yy();
nsimhit++;
*outSimHitF << nsimhit << " " << (*iLay1)->module() <<" "<< "barrel" << " " << nlay <<" "<< anello << " " << nmod << " " << posx1 << " " << posy1 << " " << posz1 << " " << x1 << " " << y1 << " "<< dx1 << " " << dy1 << endl;
}
}
}
}
}
The result:
1 silicon forward 1 4 30 -0.557684 -0.0710207 -2.6375 -2.34123 0 0.0191961 11.04 2 silicon forward 1 4 30 -0.555236 -0.085427 -2.6375 -0.879943 0 0.00272552 11.04 3 silicon forward 1 4 30 -0.552633 -0.100746 -2.6375 0.673891 0 0.0016052 11.04 4 silicon forward 1 4 29 -0.562115 -0.00838537 -2.6345 -2.31599 0 0.0187848 11.04 5 silicon forward 1 4 29 -0.560971 -0.0287406 -2.6345 -0.277253 0 0.000285123 11.04 6 silicon forward 1 4 29 -0.559842 -0.0488352 -2.6345 1.73538 0 0.0105539 11.04 7 silicon forward 1 4 29 -0.559403 -0.0566546 -2.6345 2.51854 0 0.0222113 11.04 8 silicon forward 1 4 28 -0.560256 0.0414884 -2.6375 -1.00234 0 0.0035317 11.04 9 silicon forward 1 4 28 -0.560395 0.0389969 -2.6375 -0.7528 0 0.00199913 11.04 10 silicon forward 1 4 28 -0.562348 0.00422147 -2.6375 2.73022 0 0.0260989 11.04
#ifndef __INCLUDE_TwigTkRecHits__
#define __INCLUDE_TwigTkRecHits__
#include <Inventor/SbString.h>
#include "Visualisation/OrcaVis/interface/AutoTwig.h"
#include "Ig_Extensions/IgGeant3/interface/G3Pars.h"
#include "CommonDet/BasicDet/interface/DetUnit.h"
#include <Inventor/SbLinear.h>
#include <fstream>
class TwigTkRecHits : public AutoTwig {
public:
typedef IgQtTwig inherited;
explicit TwigTkRecHits(IgQtTwig* parent, SbString nm, bool b=true, bool
c=false) :
AutoTwig(parent, nm, b, c) {
outSimHitF = new ofstream("SimHitF.dat",ios::out);
}
void drawMe();
private:
ofstream* outSimHitF;
};
#endif
Code for TwigTkRecHits.cc
#include "Utilities/Configuration/interface/Architecture.h"
#include "Visualisation/TrackerVis/interface/TwigTkRecHits.h"
#include <iostream>
#include "Tracker/CARFTracker/interface/FullTracker.h"
#include "Tracker/TkLayout/interface/CmsTracker.h"
#include "CommonDet/DetGeometry/interface/GlobalPoint.h"
#include "CommonDet/DetGeometry/interface/TkRotation.h"
#include "CommonDet/DetGeometry/interface/Surface.h"
#include "CommonDet/DetGeometry/interface/ActiveMediaShape.h"
#include "CommonDet/DetLayout/interface/DetLayer.h"
#include "CommonDet/BasicDet/interface/DetUnit.h"
#include "CommonDet/BasicDet/interface/Enumerators.h"
#include "CommonDet/BasicDet/interface/Det.h"
#include "CommonDet/BasicDet/interface/DetType.h"
void TwigTkRecHits::drawMe() {
inherited::drawMe();
const CmsTracker::LayerContainer& theLayerContainer = FullTracker::instance()->Tracker()->forwardLayers();
CmsTracker::layer_p_iter iLay;
int det_type=0;
int nlay=0;
int nmod1=0;
int anello = 0;
int nmod = 0;
int ntotmod = 0;
float r;
float phi,phi1;
float hbotedge, htopedge, hapothem, hthickness;
int spicchi[] ={24,24,40,56,40,56,80};
float rmedioS[]={0.27665, 0.3671, 0.4474, 0.5617, 0.6768, 0.8189, 0.9912};
float rmedioP[]={0.064122, 0.0766412, 0.0899707, 0.10658, 0.12008, 0.137039, 0.145999};
for (iLay = theLayerContainer.begin(); iLay != theLayerContainer.end(); iLay++) {
nlay++;
Module layer_type = (*iLay)->module();
const CmsTracker::DetContainer theDetContainer = (*iLay)->detUnits();
CmsTracker::det_p_iter iDet;
for (iDet = theDetContainer.begin() ; iDet != theDetContainer.end() ; iDet++) {
float posx = (*iDet)->surface().position().x()/ 100.0; // cm -> m
float posy = (*iDet)->surface().position().y()/ 100.0; // cm -> m
float posz = (*iDet)->surface().position().z()/ 100.0; // cm -> m
r=pow((posx*posx + posy*posy),0.5);
phi1=atan(posy/posx);
phi=phi1;
if(posy < 0.&&posx>0)phi=phi1+2.*3.1415;
if(posx < 0.)phi=phi1+3.1415;
if(fabs(posy)<0.000001&&posx>0)phi=0;
if(fabs(posy)<0.000001&&posx<0)phi=3.1415;
if(fabs(posx)<0.000001&&posy>0)phi=3.1415/2.;
if(fabs(posx)<0.000001&&posy<0)phi=3.1415/2.;
det_type=1;
if (layer_type==silicon) {
det_type=2;
for (int i=0;i<7; i++){
if (fabs(r-rmedioS[i])<0.0001){
anello =i+1;
break;
}
}
nmod=(int)((phi/(2.*3.1415))*spicchi[anello-1]+.1)+1;
}
else{
for (int i=0; i<7; i++){
if(fabs(r -rmedioP[i])<0.0001){
anello=i+1;
break;
}
}
nmod=(int)((phi/(2.*3.1415))*24+.1)+1;
}
if (layer_type==silicon && (*iDet)->type().isStereo()) nmod=nmod+100;
const vector par = (*iDet)->type().shape().parameters();
if (par.size() == 3) {
hbotedge= (*iDet)->type().shape().width()/ 100.0;
htopedge= (*iDet)->type().shape().width()/ 100.0;
hapothem=(*iDet)->type().shape().length()/ 100.0;
hthickness= (*iDet)->type().shape().thickness()/ 100.0;
} else if (par.size() == 4) {
hbotedge=par[0]/100.0;
htopedge=par[1]/100.0;
hapothem=par[3]/100.0;
hthickness=par[2]/100.0; }
ntotmod++;
*outSimHitF << ntotmod << " " << det_type << " 1 " << nlay <<" "<< anello << " " << nmod << " " << posx << " " << posy << " " << posz << " " << hbotedge << " " << htopedge << " " << hapothem << " "<< hthickness << endl;
}
}
const CmsTracker::LayerContainer& theLayerContainer1 = FullTracker::instance()->Tracker()->barrelLayers();
CmsTracker::layer_p_iter iLay1;
nmod1=0;
nmod = 0;
float oldz;
int spicchib[] ={18,30,42,28,38,44,56,42,48,54,60,66,74};
for (iLay1 = theLayerContainer1.begin(); iLay1 != theLayerContainer1.end(); iLay1++) {
nlay++;
anello = -1;
Module layer_type1 = (*iLay1)->module();
const CmsTracker::DetContainer theDetContainer1 = (*iLay1)->detUnits();
CmsTracker::det_p_iter iDet1;
for (iDet1 = theDetContainer1.begin() ; iDet1 != theDetContainer1.end() ; iDet1++) {
float posx1 = (*iDet1)->surface().position().x()/ 100.0; // cm -> m
float posy1 = (*iDet1)->surface().position().y()/ 100.0; // cm -> m
float posz1= (*iDet1)->surface().position().z()/ 100.0; // cm -> m
if (anello == -1){
oldz = posz1;
anello = 1;
}
else{
if((nlay<36 && fabs(oldz - posz1) > 0.001) ||
( nlay>35 && fabs(oldz - posz1) > 0.05 ))
{
oldz = posz1;
anello++;
}
}
r=pow((posx1*posx1 + posy1*posy1),0.5);
phi1=atan(posy1/posx1);
phi=phi1;
if(posy1 < 0.&&posx1>0)phi=phi1+2.*3.1415;
if(posx1 < 0.)phi=phi1+3.1415;
if(fabs(posy1)<0.000001&&posx1>0)phi=0;
if(fabs(posy1)<0.000001&&posx1<0)phi=3.1415;
if(fabs(posx1)<0.000001&&posy1>0)phi=3.1415/2.;
if(fabs(posx1)<0.000001&&posy1<0)phi=3.1415/2.;
nmod=(int)((phi/(2.*3.1415))*spicchib[nlay-29]+.1)+1;
det_type=1;
if (layer_type1==silicon) det_type=2;
if (layer_type1==silicon && (*iDet1)->type().isStereo()) nmod=nmod+100;
const vector par = (*iDet1)->type().shape().parameters();
if (par.size() == 3) { // Rectangular
hbotedge= (*iDet1)->type().shape().width()/ 100.0;// cm -> m
htopedge= (*iDet1)->type().shape().width()/ 100.0; // cm -> m
hapothem=(*iDet1)->type().shape().length()/ 100.0; // cm -> m
hthickness= (*iDet1)->type().shape().thickness()/ 100.0; // cm -> m
} else if (par.size() == 4) { // Trapezoidal
hbotedge=par[0]/100.0; // cm -> m
htopedge=par[1]/100.0; // cm -> m
hapothem=par[3]/100.0; // cm -> m
hthickness=par[2]/100.0; // cm -> m
}
ntotmod++;
*outSimHitF << ntotmod << " " << det_type <<" 2 " << nlay <<" "<< anello << " " << nmod << " " << posx1 << " " << posy1 << " " << posz1 << " " << hbotedge << " " << htopedge << " " << hapothem << " "<< hthickness << endl;
}
}
}
The result:
1 2 1 1 4 30 -0.553762 -0.0941021 -2.6375 0.029 0.0356 0.05755 0.00015 2 2 1 1 4 29 -0.560816 -0.0315088 -2.6345 0.029 0.0356 0.05755 0.00015 3 2 1 1 4 28 -0.560817 0.0314807 -2.6375 0.029 0.0356 0.05755 0.00015 4 2 1 1 4 27 -0.553766 0.0940744 -2.6345 0.029 0.0356 0.05755 0.00015 5 2 1 1 4 23 -0.458109 0.325028 -2.6375 0.029 0.0356 0.05755 0.00015 6 2 1 1 4 22 -0.418837 0.374276 -2.6345 0.029 0.0356 0.05755 0.00015 7 2 1 1 4 21 -0.374298 0.418818 -2.6375 0.029 0.0356 0.05755 0.00015 8 2 1 1 4 20 -0.325051 0.458092 -2.6345 0.029 0.0356 0.05755 0.00015 9 2 1 1 4 16 -0.0941023 0.553761 -2.6375 0.029 0.0356 0.05755 0.00015 10 2 1 1 4 15 -0.0315091 0.560816 -2.6345 0.029 0.0356 0.05755 0.00015
Partition Magic. You must understand what are partitions and how the dual boot works. Of course, if you don't need Windows, than you can skip this phase and everything is more easy.
scram build and nothing happens! What's wrong? To discover
the reason you have first to understand how SCRAM works and look inside
the hundreds of files it uses to create the makefile that gets the code
compiled.
DDD - Detector Description Database is a database describing (guess it!) the detector on ascii files containing XML tags plus a C++ Api to access this description. Fortunately for us the final users can (probably) safely ignore all the technicalities.
LCG - LHC Computing Grid project. A group of people working (among other things) on the replacement of Objectivity with Root.
Root - A Cern software by the same people that gave us Paw and Zebra. Root is intended in fact as a OO replacement for these successfull packages. Root will provide also the object persistency replacing Objectivity. In principle COBRA will hide end-users like us from the complexities of Root. But ,judging from the Root home page it is also possible that,in the future, it will bring at last an easy interface Paw-like for those that don't know oop.
POOL - Pool Of persistent Objects for LHC is the software provided by LCG that will take care of persistency of objects(in slang the persistency framework) this is the name of the root replacement of Objectivity.
For what concerns this document the most important change was the release of Iguana 4 with the new plugin architecture. This means ,said in plain words, that the objects like TwigMuBarRpcSimHits that we used in the previous paragraphs don't anymore exist:i.e. catastrophe! We have to restart from scratch!
ORCA_7.0 brings all these new things and it is interesting to compare the list of used packages with the same list for the previous release.
An inspection of the CVS repository for Visualization/MuonVis shows that the objects used in the previous paragraph have been thrown in the Attic but they seems to be replaced by the following new objects:
To start the visualisation, type "iguana" and select "COBRA". To display an object, first select the object and then click on the visualisaton box next to it.Obvious? Isn't it! So these are the steps to run the iguana plugin with ORCA_6_3_0 (this is the first release the plugin architecture was introduced in Orca)
Now we try to add a branch "Event/Muon/Barrel/RpcMyHits" by cloning the branch "Event/Muon/Barrel/RpcSimHits" The complete procedure is:
m_document->addContentProxy ("COBRA/Event/CustomTracker");
Xlib: extension "GLX" missing on display "lxplus080:23.0". Inventor error in SoQtGLWidget::SoQtGLWidget(): OpenGL not available!The brave new world has to wait...
Xlib: extension "GLX" missing on display "lxplus010:15.0".But now I know that the problem is with my computer X server that lacks this Opengl extension.
rfdir suncmsc:/data/valid/ORCA_7_2_0Iguana (that now uses the Coin 3D implementation of OpenInventor) is again almost unusable. We are two years back with many visualizations no more working and continuous crashes.
m_document->addContentProxy ("ORCA/Event/CustomTracker");
mv src/VisTkEventContent.cc src/VisCuTkEventContent.cc mv src/VisTkTwig.cc src/VisCuTkTwig.cc mv src/VisTkSimHitsTwig.cc src/VisCuTkSimHitsTwig.cc mv interface/VisTkEventContent.h interface/VisCuTkEventContent.h mv interface/VisTkTwig.h interface/VisCuTkTwig.h mv interface/VisTkSimHitsTwig.h interface/VisCuTkSimHitsTwig.h
ootoolmgr.It allows you to explore only the catalog but not the data(the single objects in the container).For these we have to use
CMS sample programs.
cvs
error: failed dependencies:
LCG.root-rh73_gcc32-3.10.02-1 = cms is needed by CMS.pax-rh73_gcc32-1.02.02-cms-2
LCG.rootcore-rh73_gcc32-3.10.02-1 = cms is needed by CMS.pax-rh73_gcc32-1.02.02-cms-2
rpm install failed! Installation aborted!
Not very encouraging.Perhaps I should read the XCMSI manual!
error: failed dependencies:
LCG.root-rh73_gcc32-3.10.02-1 = cms is needed by CMS.pax-rh73_gcc32-1.02.02-cms-2
LCG.rootcore-rh73_gcc32-3.10.02-1 = cms is needed by CMS.pax-rh73_gcc32-1.02.02-cms-2
rpm install failed! Installation aborted!
It's time to send some mail around!The first tip is to add "--nodeps" to the
install options (since the problems seems only to be the misnaming of dependencies in a package).This is done clicking on "Options".
I try again and ,apart from the usual last message, IGUANACMS is installed!
It works! Total time elapsed:around 2 days. Not so bad!
ExRunEvent in module Workspace.
This program doesn't do nothing useful but reading input events and giving
a summary of how many they were.In principle you can use it as a template
to write more interesting programs but this is not straightforward
since you must know the CMS data model! Anyhow we would like to run this
program on the Grid. But before doing this we review briefly how to run it on your
desktop.
tcsh setenv VO_CMS_SW_DIR /opt/exp_software/cms source /opt/exp_software/cms/cmsset_default.csh
InputFileCatalogURL = @{xmlcatalog_http://webcms.ba.infn.it/cms-software/orca/hg03_hzz_2e2mu_130a_rfio.xml}@
and the Input Collection
InputCollections = /System/hg_2x1033PU761_TkMu_g133_CMS/hg03_hzz_2e2mu_130a/hg03_hzz_2e2mu_130a
Now we run ExRunEvent on the Grid:
The following steps are very well documented and are needed to be done only
once.
.globus directory
mkdir .globus openssl pkcs12 -nocerts -in cert.p12 -out ~/.globus/userkey.pem openssl pkcs12 -clcerts -nokeys -in cert.p12 -out ~/.globus/usercert.pem chmod 0400 ~/.globus/userkey.pem
grid-proxy-initthat will enable you to use the grid for 12 hours.
globus-job-run gridba2.ba.infn.it /bin/hostnameTo run our Helloworld on the Grid we must write a file in a language called jdl (job description language) and specify which program we must run , the input files, the output files, etc.. and then send this file to the Grid. Not easy for a newby. So I'll use the tool CRAB that will do everything for you. First of all you download CRAB using CVS.
crab.cfg
eval `scram runtime -csh`in the correct directory (i.e. the program will use the environment variables set by SCRAM to get everything).
./crab.py -bunch_creation 2 -bunch_submission 2To check job status:
edg-job-status -i Jobs/log/submission_id.log
gocosine;eval`scramv1 run csh`;HistoServer; gocosine;eval`scramv1 run csh`;testClient;For the server I proceed in the following way:my original program runs in Orca in "ORCA/Tracker/SiPixelDet/test". But , remember, COSINE replaces ORCA: so I start by committing Tracker/SiPixelDet in the directory COSINE_2_0_1_pre3/src. My program is called BuildMap and I have to do some small changes in order to run it under COSINE:
//added following include
#include "SubfarmManager/RootMonitorThread/interface/RootMonitorThread.h"
#include "DaqPrototype/DaqMonitor/interface/MonitorElement.h"
#include "DaqPrototype/DaqMonitorRoot/interface/DaqMonitorROOTBackEnd.h"
//Before starting analysis,instead of histogram booking:
if(firstevt){
firstevt=false;
// default source name
string sfuname = "FU0";
// default collector host name
string hostname = "localhost";
// default monitoring period (microsecs)
int period = 1000000;
// default # of monitoring cycles
//unsigned int n_cycles = 20000;
cout << " Source " << sfuname << " begins sending monitoring to host " <<
hostname << "\n with period " << period << " microsecs" << endl;
RootMonitorThread *od =
new RootMonitorThread(hostname, 9090, period, sfuname);
// start back-end interface instance
DaqMonitorBEInterface *dbe = DaqMonitorROOTBackEnd::instance();
dbe->setCurrentFolder("C1");
count = dbe->book2D("histo1", "Count ",
NBINS, 0, float (NBINS), NBINS1, 0.0, NBINS1);
total = dbe->book2D("histo2", "Total",
NBINS, 0, float (NBINS), NBINS1, 0.0, NBINS1);
dbe->showDirStructure();
od->release();
}
//This code replaces histogram filling
count->Fill(idLayer+1,idModule+1);
total->Fill(idLayer+1,idModule+1,simHitsSize);
//We add also this call to avoid data lost because the data is sent too fast:
usleep(1000); // this is 1 ms
We compile the program and run it like we did with Orca. But now the data
is automatically collected from the collector.
The client doesn't need any modification since it subscribes all data from
the collector. Now the result is having the scatter plots saved from the
client. It is a complex way to do an histogram but the server is just simulating online data taking(well online we don't have simhits: but here we would like
only to see how it works).