StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
makeTimingFiles.C
1 void makeTimingFiles( Char_t *file="R6020047.lis",
18  Float_t timing= 8.00,
19  Int_t adc_cut=25,
20  Char_t *flavor="tower",
21  Int_t numberOfFilesInt=100,
22  Char_t *dir ="./",
23  Char_t *outdir="towers/"
24  )
25 {
26 
27 
28  // cout << "RUNNING job " << jobId << ": reading " << numberOfFilesInt << " and writing output to "
29  // << scratchDir << endl;
30 
31  // load shared libraries
32  // first MuDst libs.
33  if (gClassTable->GetID("TTable") < 0) {
34  gSystem->Load("libStar");
35  gSystem->Load("libPhysics");
36  }
37  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
38  loadSharedLibraries();
39 
40 
41  // load my analysis library
42  gSystem->Load("StEEmcPoolTIMING");
43 
44 
45  StChain *myChain = new StChain("myChain");
46 
47  StMuDstMaker *muDstMaker = new StMuDstMaker(0,0,dir,file,"MuDst.root",numberOfFilesInt);
48  TChain* tree=muDstMaker->chain(); assert(tree);
49  int nEntries=tree->GetEntries();
50  nEntries = 80000; //kludge
51 
52  StMuEEmcCrateTimingMaker* myEEmcCrateTimingMaker = new StMuEEmcCrateTimingMaker(muDstMaker);
53  myEEmcCrateTimingMaker->setFlavor(flavor);
54  myEEmcCrateTimingMaker->setTiming(timing);
55  myEEmcCrateTimingMaker->setDirectory(outdir);
56  myEEmcCrateTimingMaker->setNumberOfChannels(adc_cut);
57  myEEmcCrateTimingMaker->setMinCounts(100);
58  myEEmcCrateTimingMaker->setPhase(6);
59 
60  TString myOutName=file;
61  myOutName.ReplaceAll("lis","");
62  myOutName.ReplaceAll("MuDst.root","");
63  myChain->PrintInfo();
64 
65 
66  muDstMaker->SetStatus("*",0);
67  muDstMaker->SetStatus("EztAll",1);
68  if(myChain->Init() != 0) cerr << "Failure during Init()!" << endl;
69 
70  Int_t iRet = 0, runNumber = -1, nEventsAna = 0;
71  while (iRet == 0) {
72  myChain->Clear();
73  iRet = myChain->Make();
74  if (iRet) {
75  cout << "rteutrn valuer snons ZEROOOOOOOOOOOOOOOOOOOOOOOOOOOOO" << endl;
76  break;
77  }
78  if (nEventsAna % 100 == 0) {
79  cout << "Analyzing event " << nEventsAna << endl;
80  }
81  nEventsAna++;
82  if (nEventsAna > nEntries) break;
83  }
84  cout << "Analysed " << nEventsAna << " events" << endl;
85  myChain->Finish();
86  delete myChain;
87 }
void setDirectory(TString directory)
Output directory.
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
virtual Int_t Finish()
Definition: StChain.cxx:85
void setFlavor(TString testFlavor="tower")
virtual Int_t Make()
Definition: StChain.cxx:110
void setTiming(Float_t timeDelay)
Specify the delay setting for this run.
TChain * chain()
In read mode, returns pointer to the chain of .MuDst.root files that where selected.
Definition: StMuDstMaker.h:426
void SetStatus(const char *arrType, int status)
void setNumberOfChannels(Int_t n=25)
Sets the number of channels above pedestal.