27 class StFgtCosmicMaker;
32 StFgtCosmicMaker *cosmicMkr = 0;
39 Int_t makeCorrelationPlot(
const Char_t *filename =
"testfile.sfs",
40 const Char_t *pedfilename =
"testfile.Ped.txt",
43 const Char_t *runname =
"testrun",
44 const Char_t *quadname =
"013",
45 Int_t numChannelsPerBin = 8,
52 cout <<
"Constructing the chain" << endl;
53 analysisChain =
new StChain(
"eemcAnalysisChain");
55 cout <<
"Constructing the cosmic maker" << endl;
56 cosmicMkr =
new StFgtCosmicMaker(
"cosmicMaker", filename );
57 cosmicMkr->setNumDiscs( numDiscs );
59 cout <<
"Constructing the QA makers" << endl;
65 plotterC->setTimeBin( timeBin );
66 plotterC->setToPlotVsStrip(
'c' );
67 plotterC->setBinFactors( numChannelsPerBin, 1 );
68 plotterC->setComputeCorrelations( 1 );
69 plotterC->setPedReaderFile( pedfilename );
72 plotterR->setTimeBin( timeBin );
73 plotterR->setToPlotVsStrip(
'R' );
74 plotterR->setBinFactors( numChannelsPerBin, 1 );
75 plotterR->setComputeCorrelations( 1 );
76 plotterR->setPedReaderFile( pedfilename );
79 plotterP->setTimeBin( timeBin );
80 plotterP->setToPlotVsStrip(
'P' );
81 plotterP->setBinFactors( numChannelsPerBin, 1 );
82 plotterP->setComputeCorrelations( 1 );
83 plotterP->setPedReaderFile( pedfilename );
85 cout <<
"Initializing" << endl;
86 ierr = analysisChain->Init();
87 cout <<
"\t done initializing" << endl;
90 cout <<
"Error initializing" << endl;
97 cout <<
"Looping over events..." << endl;
98 for(
int i=0; i<nevents && !ierr; ++i ){
101 cout <<
"event number " << i << endl;
104 analysisChain->
Clear();
107 ierr = analysisChain->
Make();
109 if( cosmicMkr->atEOF() )
116 cout <<
"finish" << endl;
119 cout <<
"Making plots..." << endl;
123 plotterC->getCovarianceHist(),
124 plotterR->getCovarianceHist(),
125 plotterP->getCovarianceHist(),
126 plotterC->getCorrelationHist(),
127 plotterR->getCorrelationHist(),
128 plotterP->getCorrelationHist()
131 gROOT->SetStyle(
"Plain");
132 gStyle->SetOptStat(0);
133 gStyle->SetEndErrorSize(0);
134 gStyle->SetTitleBorderSize(0);
135 gStyle->SetTitleTextColor(kRed);
136 gStyle->SetPalette(1);
138 TCanvas *can =
new TCanvas(
"fgtCorCan",
"fgtCorCan", 1800, 1200 );
141 for( Int_t i=0; i<6; ++i ){
143 gPad->SetRightMargin( 0.02 );
144 gPad->SetLeftMargin( 0.13 );
146 cout <<
"Plot " << i <<
' ' << hPlots[i] << endl;
148 hPlots[i]->GetYaxis()->SetTitleOffset( 1.55 );
150 hPlots[i]->Draw(
"COLZ");
154 cout <<
"ready to save" << endl;
156 std::string fileOut =
"fgtCosmic-CorPlot.";
163 cout <<
"\tsaving to '" << fileOut <<
"'" << endl;
164 can->Print( fileOut.data() );
166 cout <<
"all done" << endl;
175 gSystem->Load(
"libPhysics");
176 gSystem->Load(
"St_base");
177 gSystem->Load(
"StChain");
178 gSystem->Load(
"StEvent");
179 gSystem->Load(
"StUtilities");
180 cout <<
"loaded StEvent library" << endl;
182 gSystem->Load(
"StFgtUtil");
183 gSystem->Load(
"StFgtRawMaker");
184 gSystem->Load(
"RTS");
185 gSystem->Load(
"StFgtPedMaker");
186 gSystem->Load(
"StFgtQaMakers");
187 gSystem->Load(
"StFgtPedPlotter");
virtual void Clear(Option_t *option="")
User defined functions.