33 int timeShape(
const Char_t *filenameIn =
"st_physics_13036040_raw_5010001.daq",
34 const Char_t *filenameOut =
"run13036040.5",
35 Int_t nevents = 100000,
37 Bool_t cutShortEvents = 0 ){
44 std::string daqFileName( filenameIn );
45 std::string::size_type pos = daqFileName.find_last_of(
".");
47 if( pos != std::string::npos && daqFileName.substr( pos ) ==
".sfs" )
52 cout <<
"Is Cosmic" << endl;
54 cout <<
"Is not cosmic" << endl;
57 cout <<
"Constructing the chain" << endl;
58 analysisChain =
new StChain(
"eemcAnalysisChain");
60 std::string fgtDbMkrName =
"";
66 cout <<
"Loading St_db_Maker" << endl;
67 gSystem->Load(
"libStDb_Tables.so");
68 gSystem->Load(
"StDbLib.so");
69 gSystem->Load(
"St_db_Maker");
70 gSystem->Load(
"StDbBroker");
72 TString dir0 =
"MySQL:StarDb";
73 TString dir1 =
"$STAR/StarDb";
75 dbMkr->SetDateTime(20120213,150645);
77 cout <<
"Loading StFgtDbMaker" << endl;
78 gSystem->Load(
"StFgtDbMaker");
80 cout <<
"Constructing StFgtDbMaker" << endl;
83 fgtDbMkrName = fgtDbMkr->
GetName();
85 cout <<
"Fgt DB Maker Name " << fgtDbMkrName << endl;
87 cout <<
"Constructing the daq reader" << endl;
89 daqRdr->setIsCosmic( isCosmic );
90 daqRdr->cutShortEvents( cutShortEvents );
91 cout <<
"Fgt DB Maker Name " << fgtDbMkrName.data() << endl;
92 cout <<
"Constructing the Time Shape Maker" << endl;
94 std::string outFileName( filenameOut );
95 tshapeMkr->fname=outFileName;
96 tshapeMkr->fitThresh=600;
97 tshapeMkr->plotThresh=700;
98 tshapeMkr->fixTau=
false;
99 tshapeMkr->Ntimebin=7;
100 tshapeMkr->pedSelect=1;
106 cout <<
"Initializing" << endl;
107 ierr = analysisChain->Init();
110 cout <<
"Error initializing" << endl;
114 if( nevents < 0 )nevents = 1<<30;
116 cout <<
"max nevents = " << nevents << endl;
117 for(
int i=0; i<nevents && !ierr; ++i ){
122 analysisChain->
Clear();
125 ierr = analysisChain->
Make();
132 cout <<
"finish" << endl;
135 cerr <<
"\tall done" << endl;
144 gSystem->Load(
"libPhysics");
145 gSystem->Load(
"St_base");
146 gSystem->Load(
"StChain");
147 gSystem->Load(
"StFgtUtil");
148 gSystem->Load(
"StUtilities");
149 gSystem->Load(
"StEvent");
150 cout <<
"loaded StEvent library" << endl;
152 gSystem->Load(
"StFgtUtil");
153 gSystem->Load(
"StFgtRawMaker");
154 gSystem->Load(
"StFgtRawDaqReader");
155 gSystem->Load(
"RTS");
156 gSystem->Load(
"StFgtTimeShapeMaker");
157 gSystem->Load(
"StFgtDbMaker");
virtual void Clear(Option_t *option="")
User defined functions.
virtual const char * GetName() const
special overload