StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
runEEmcL2Timing.C
1 /******************************************************************************
2  **
3  ** runEEmcTiming.C
4  **
5  ** Arguements:
6  **
7  ** nevents - number of events to process
8  ** name - filename, format = <run>.list, eg 8081048.list, containing
9  ** a list of MuDst's from a single run
10  ** ofile - output histogram filename, suggested <run>.root. Output
11  ** will be saved in subdirectory timing_files/
12  **
13  ** tower_delay - the TCD phase delay (towers) for this run
14  ** mapmt_delay - the TCD phase delay (mapmt) for this run
15  **
16  **/
17 
18 class StChain;
19 class St_db_Maker;
20 class StEEmcDb;
21 class StMuDstMaker;
22 class StEEmcA2EMaker;
23 class StEEmcTimingMaker;
24 
25 //--
26 //-- globals
27 //--
28 StChain *mChain = 0;
29 St_db_Maker *mStarDatabase = 0;
30 StEEmcDb *mEEmcDatabase = 0;
31 StMuDstMaker *mMuDstMaker = 0;
32 StEEmcA2EMaker *mEEanalysis = 0;
33 
34 Int_t count = 0;
35 Int_t stat = 0;
36 
37 Int_t nzeros = 0;
38 Int_t max_zero_count = 100;
39 
40 
41 void runEEmcL2Timing( Int_t nevents = 30000,
42  Char_t *name = "8327013.list",
43  Char_t *ofile= "8327013.root",
44  Float_t tower_delay=19.,
45  Float_t mapmt_delay=65.,
46  Int_t nfiles = 1000
47  )
48 {
49 
50  Char_t *path = "./";
51  TString pathname = path;
52  pathname += name;
53 
54  //--
55  //-- Load shared libraries
56  //--
57  LoadLibs();
58  gMessMgr -> SwitchOn("I");
59 
60  gSystem->mkdir("timing_files/");
61  TString myofile="timing_files/";
62  myofile += ofile;
63 
64  TFile *out=new TFile(ofile,"recreate");
65  StEEmcTimingMaker *timing=new StEEmcTimingMaker("timing");
66  timing->setRunNumber( atoi( name ) );
67  timing->setTiming( tower_delay, mapmt_delay );
68  timing->setTowerCuts( 25, 75 );
69  timing->setMapmtCuts( 50, 150 );
70  timing->setOutputFile( myofile );
71 
72  timing->addTowerMask( 2, 98 ); // crate 2 ch 98 looks hot
73 
74 
75  ifstream input(name);
76  Char_t buf[256];
77  input >> buf;
78 
79  timing->processFromL2(buf,nevents);
80  timing->Finish();
81 
82  return;
83 
84 }
85 
86 void LoadLibs()
87 {
88  //-- Load muDst shared libraries --
89  gROOT -> LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
90  loadSharedLibraries();
91 
92  gSystem->Load("StDbLib");
93  gSystem->Load("StDbBroker");
94  gSystem->Load("St_db_Maker");
95  gSystem->Load("StEEmcUtil");
96  gSystem->Load("StEEmcDbMaker");
97  gSystem->Load("StEEmcSimulatorMaker");
98 
99  gSystem->Load("StEEmcA2EMaker");
100  gSystem->Load("StEEmcTimingMaker");
101 
102 }
103 
EEmc ADC –&gt; energy maker.
void processFromL2(const Char_t *name, int nevents)
Process ready-made histograms from level 2.
void addTowerMask(Int_t cr, Int_t ch)
Add a tower mask. Count crates from 1, channels from 0.