StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rdMu2FgtShort.C
1 #include "StRoot/StMuDSTMaker/COMMON/StMuArrays.h"
2 class StFgtEvent;
3 
4 rdMu2FgtShort() {
5  int nEve=1;
6  Int_t nFiles = 1;
7  //char *inDir="/star/u/sgliske/FGT/2012-Jan/leak-test/test4/";
8  char *inDir="./";
9  char *file="QCDprodMBa.MuDst.root";
10 
11 
12  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
13  loadSharedLibraries();
14 
15  cout << " loading done " << endl;
16  chain = new StChain("StChain"); // create chain
17 
18  // Now we add Makers to the chain...
19  muMk = new StMuDstMaker(0,0,inDir,file,"MuDst.root",nFiles);
20  TChain* tree=muMk->chain(); assert(tree);
21  int nEntries=(int) tree->GetEntries();
22  printf("total eve in muDst chain =%d\n",nEntries); // return ;
23  if(nEntries<0) return;
24 
25  chain->Init();
26  // chain->ls(3);
27 
28  chain->Clear();
29  int stat = chain->Make();
30  printf("EEEE stat=%d\n",stat);
31 
32  // Access to muDst .......................
33  StMuEvent* muEve = muMk->muDst()->event();
34  assert(muEve);
35 
36  printf("JJJJJ check 1 for FGT\n");
37  TClonesArray *fgtStrips = muMk->muDst()->fgtArray( muFgtStrips );
38  assert( fgtStrips );
39 
40  Int_t nStrips = fgtStrips->GetEntriesFast();
41  printf("JJJJJ check 2 for FGT nStrips=%d\n",nStrips);
42  for( Int_t i = 0; i < nStrips; ++i ){
43  StMuFgtStrip* strip = static_cast< StMuFgtStrip* >( (*fgtStrips)[i] );
44  if(strip==0) continue;
45  Int_t geoId = strip->getGeoId();
46  Short_t seedType=strip->getClusterSeedType();
47  printf("i=%d geoId=%d charge=%.1f +/-%.1f seedType=%d\n",i,geoId, strip->getCharge(), strip->getChargeUncert(),seedType);
48  }
49 
50 
51  TClonesArray * fgtClusters = muMk->muDst()->fgtArray( muFgtClusters );
52  assert( fgtClusters );
53  Int_t nClusters = fgtClusters->GetEntriesFast();
54  printf("JJJJJ check 3 for FGT nClusters=%d\n",nClusters);
55  for( Int_t i = 0; i < nClusters; ++i ){
56  StMuFgtCluster* clus = static_cast< StMuFgtCluster* >( (*fgtClusters)[i] );
57  if(clus==0) continue;
58  Int_t geoId = clus->getCentralStripGeoId();
59  printf("i=%d cntrGeoId=%d charge=%.1f R=%.1f+/-%.1f phi=%.3f+/-%.3f nStrip=%d\n",i,geoId , clus->getCharge(), clus->getR(),clus->getErrR(), clus->getPhi(), clus->getErrPhi(), clus->getNumStrips());
60  }
61 
62  TClonesArray * fgtInfo = muMk->muDst()->fgtArray( muFgtInfo );
63  assert( fgtInfo );
64  Int_t nInfo = fgtInfo->GetEntriesFast();
65  printf("JJJJJ check 4 for FGT nInfo=%d\n",nInfo);
66  for( Int_t i = 0; i < nInfo; ++i ){
67  StMuFgtInfo* info = static_cast< StMuFgtInfo* >( (*fgtInfo)[i] );
68  if(info==0) continue;
69  //printf("i=%d info=%s=\n",i,info->mMsg);
70  }
71 
72  printf("JJJJJ check 9 for FGT done\n\n");
73  return ;
74 #if 0
75 #include "StRoot/StMuDSTMaker/COMMON/StMuFgtStrip.h"
76 #include "StRoot/StMuDSTMaker/COMMON/StMuFgtCluster.h"
77  StRoot/StMuDSTMaker/COMMON/StMuFgtInfo.h
78 #endif
79 
80 }
StMuDst * muDst()
Definition: StMuDstMaker.h:425
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
virtual Int_t Make()
Definition: StChain.cxx:110
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320
TChain * chain()
In read mode, returns pointer to the chain of .MuDst.root files that where selected.
Definition: StMuDstMaker.h:426
static TClonesArray * fgtArray(int type)
returns pointer to the n-th TClonesArray from the fgt arrays
Definition: StMuDst.h:293