StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
exampleEmc.C
1 // NOTE - chain needs to be declared global so for StHbtEventReader
2 //==========================================================================================
3 class StMuDstMaker;
4 
5 StMuDstMaker* maker;
6 
7 void exampleEmc(const char* list) {
8  if (gClassTable->GetID("TTable") < 0) {
9  gSystem->Load("libTable");
10  gSystem->Load("libPhysics");
11  }
12  gSystem->Load("St_base");
13  gSystem->Load("StChain");
14  gSystem->Load("St_Tables");
15  gSystem->Load("StMagF");
16  gSystem->Load("StUtilities"); // new addition 22jul99
17  gSystem->Load("StTreeMaker");
18  gSystem->Load("StIOMaker");
19  gSystem->Load("StarClassLibrary");
20  gSystem->Load("StTpcDb");
21  gSystem->Load("StDbUtilities");
22  gSystem->Load("StEvent");
23  gSystem->Load("StEventUtilities");
24  gSystem->Load("StMcEvent");
25  gSystem->Load("StMcEventMaker");
26  gSystem->Load("StAssociationMaker");
27  gSystem->Load("StMcAnalysisMaker");
28  gSystem->Load("StStrangeMuDstMaker");
29  gSystem->Load("StEmcUtil");
30  gSystem->Load("StMuDSTMaker");
31 
32  cout << " loading done " << endl;
33 
34  StMuDebug::setLevel(0); // switch of some debug output
35 
36  int iret=0;
37  maker = new StMuDstMaker(0,0,"",list,"MuDst.root",20); // set up maker in read mode
38  StMuDbReader* db = StMuDbReader::instance();
39  // db->addDb("/star/u/laue/afsWork/P02gc.db");
40  // db->addDb("/star/u/laue/afsWork/P02gd.db");
41 
42  int eventCounter=0;
43  while ( !maker->Make() ) {
44  cout << " event# " << eventCounter++ << endl;
45  StMuEvent* e = maker->muDst()->event();
46  StMuEmcCollection* emc = maker->muDst()->emcCollection();
47  if (emc) {
48  /*
49  for (int n=3; n<=4; n++) {
50  int nSmdHits = emc->getNSmdHits(n);
51  cout << "SmdHits: " << nSmdHits << endl;
52  for (int i=0; i<nSmdHits; i++) {
53  StMuEmcHit* h = emc->getSmdHit(n,i);
54  printf("SmdHit(%02i,%02i): energy=%f adc=%f\n",n,i,h->getEnergy(), h->getAdc());
55  }
56  }
57  */
58  for (int n=1; n<=4; n++) {
59  int nClusters = emc->getNClusters(n);
60  cout << "Clusters: " << nClusters << endl;
61  for (int i=0; i<nClusters; i++) {
62  StMuEmcCluster* c = emc->getCluster(n,i);
63  printf("Cluster(%02i,%02i): energy=%f phi=%f eta=%f nHits=%d \n",n,i,c->getEnergy(), c->getPhi(), c->getEta(), c->getNHits() );
64  }
65  }
66  int nPoints = emc->getNPoints();
67  for (int i=0; i<nPoints; i++) {
68  StMuEmcPoint* p = emc->getPoint(i);
69  printf("Point(%02i) : energy=%f phi=%f eta=%f \n",i,p->getEnergy(), p->getPhi(), p->getEta());
70  }
71  }
72  }
73 
74 }
75 
76 
77 
virtual int Make()
StMuDst * muDst()
Definition: StMuDstMaker.h:425
float getEnergy() const
Return Energy of the point.
Definition: StMuEmcPoint.h:31
StMuDstMaker(const char *name="MuDst")
Default constructor.
int getNHits() const
Return Number of hits of the cluster.
static void setLevel(unsigned int level)
sets the debug level
Definition: StMuDebug.h:74
float getPhi() const
Return Phi of the cluster.
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320
float getPhi() const
Return Phi of the point.
Definition: StMuEmcPoint.h:27
static StEmcCollection * emcCollection()
returns pointer to current StEmcCollection
Definition: StMuDst.h:405
float getEta() const
Return Eta of the cluster.
float getEta() const
Return Eta of the point.
Definition: StMuEmcPoint.h:26