24 #if !defined(__CINT__) || defined(__MAKECINT__) 26 #include <Riostream.h> 31 #include "TGridResult.h" 32 #include "THashList.h" 42 #include "TObjArray.h" 43 #include "TObjString.h" 44 #include "TFileMerger.h" 46 #include "AliCounterCollection.h" 78 void PlotMuonQA(
const char* baseDir,
const char* runList = 0x0,
const char * triggerList = 0x0,
Bool_t selectPhysics = kFALSE,
const char *LHCPeriod =
"LHC11c",
const char *QAFileName =
"QAresults.root") {
85 #if defined(__CINT__) && !defined(__MAKECINT__) 94 gSystem->Load(
"libANALYSISalice");
101 gStyle->SetFillColor(10);
102 gStyle->SetPadGridX(kTRUE);
103 gStyle->SetPadGridY(kTRUE);
104 gStyle->SetPadRightMargin(0.01);
106 TString OutFileName =
"QA_"; OutFileName += LHCPeriod;
107 TString OutFileNamePDF= OutFileName.Data(); OutFileNamePDF+=
".pdf";
108 TString OutFileNamePDF_open = OutFileNamePDF.Data(); OutFileNamePDF_open +=
"[";
109 TString OutFileNamePDF_close= OutFileNamePDF.Data(); OutFileNamePDF_close +=
"]";
110 TString OutFileNameROOT= OutFileName.Data(); OutFileNameROOT+=
".root";
116 gEnv->SetValue(
"XNet.ConnectTimeout",10);
117 gEnv->SetValue(
"XNet.RequestTimeout",10);
118 gEnv->SetValue(
"XNet.MaxRedirectCount",2);
119 gEnv->SetValue(
"XNet.ReconnectTimeout",10);
120 gEnv->SetValue(
"XNet.FirstConnectMaxCnt",1);
123 TH1::AddDirectory(kFALSE);
125 TString alienBaseDir = baseDir;
127 if (alienBaseDir.Contains(
"alien:") && !TGrid::Connect(
"alien://")) {
128 Error(
"MergeQA",
"cannot connect to grid");
132 cout<<
"//---------------------------------- //"<<endl;
133 cout<<
"// Run selection //"<<endl;
134 cout<<
"//---------------------------------- //"<<endl;
137 runs->SetOwner(kTRUE);
141 TString select = selectPhysics ?
"selected:yes" :
"";
143 cout<<
"//---------------------------------- //"<<endl;
144 cout<<
"// Get global counter //"<<endl;
145 cout<<
"//---------------------------------- //"<<endl;
147 TString mergedFilename = Form(
"%s/%s", baseDir,QAFileName);
150 TFile *globalFile = TFile::Open(mergedFilename.Data());
151 if (!globalFile || ! globalFile->IsOpen()) {
152 Error(
"PlotQA",
"failed to open file: %s", mergedFilename.Data());
155 globalFile->Cd(
"MUON_QA");
160 AliCounterCollection* eventCounters =
static_cast<AliCounterCollection*
>(globalFile->FindObjectAny(
"eventCounters"));
161 AliCounterCollection* trackCounters =
static_cast<AliCounterCollection*
>(globalFile->FindObjectAny(
"trackCounters"));
164 if (!runList) selectRuns += trackCounters->GetKeyWords(
"run");
166 cout<<
"//---------------------------------- //"<<endl;
167 cout<<
"// Trigger selection //"<<endl;
168 cout<<
"//---------------------------------- //"<<endl;
170 TObjArray *triggersB, *triggersShortName;
172 triggersB->SetOwner();
174 triggersShortName->SetOwner();
176 TString listFromContainer = eventCounters->GetKeyWords(
"trigger");
180 cout<<
"//---------------------------------- //"<<endl;
181 cout<<
"// Set collision type ? //"<<endl;
182 cout<<
"//---------------------------------- //"<<endl;
184 Bool_t isHeavyIon = kTRUE;
187 cout<<
"//---------------------------------- //"<<endl;
188 cout<<
"// Trigger plots //"<<endl;
189 cout<<
"//---------------------------------- //"<<endl;
192 TString CanvasName =
"AllTriggers";
195 cout<<
"//---------------------------------- //"<<endl;
196 cout<<
"// Processing event counters //"<<endl;
197 cout<<
"//---------------------------------- //"<<endl;
201 TCanvas *c1 =
new TCanvas(CanvasName.Data(),CanvasName.Data());
208 TArrayI colorInd( triggersB->GetEntriesFast() );
209 Int_t const colorNrFirst = 8;
210 Int_t colorIndex = 0;
211 Int_t colorTabFirst[colorNrFirst] = {kGray+2,kRed,kBlue,kGreen,kOrange,kCyan,kMagenta,kYellow};
212 for (
Int_t i = 0; i < triggersB->GetEntriesFast(); i++ ) {
213 colorInd[i] = colorTabFirst[i%colorNrFirst] + colorIndex;
214 if ( i%colorNrFirst == 0 ) colorIndex++;
218 Int_t nTrig = triggersB->GetEntriesFast();
222 TObjArray trigWithPST0Flag(nTrig*nCentBin);
223 TObjArray trigWithPST0SPDFlag(nTrig*nCentBin);
231 TObjArray trackAllMatched(nTrig*nCentBin);
232 TObjArray trackMatchedLowPt(nTrig*nCentBin);
233 TObjArray trackMatchedHighPt(nTrig*nCentBin);
235 TObjArray trackPosMatched(nTrig*nCentBin);
236 TObjArray trackNegMatched(nTrig*nCentBin);
238 TObjArray trackBeamGasMatched(nTrig*nCentBin);
239 TObjArray trackBeamGasMatchedHighPt(nTrig*nCentBin);
241 cout<<Form(
"Processing for %d triggers...",triggersB->GetEntriesFast())<<endl;
244 for (
Int_t iCentBin = 0; iCentBin < nCentBin; iCentBin++){
245 selectionCent = kCentBinName[iCentBin];
248 for(
Int_t iTrig = 0; iTrig < triggersB->GetEntriesFast(); iTrig++){
250 TString histoNameBase =
"h_trig", histoName;
251 histoNameBase+= iTrig+1;
257 TString triggerName = ( (TObjString*) triggersB->At(iTrig) )->GetString();
258 if(triggerName.EqualTo(
" "))
continue;
260 selection = selectionCent; selection += Form(
"trigger:%s/%s", triggerName.Data(), selectRuns.Data());
262 histoName = histoNameBase;
263 histoName +=
"BNoPS";
264 histo = (
TH1*)
ProcessHisto(eventCounters,
"run", selection, histoName,
"",
"Trigger content w/o Phys. Sel.", colorInd[iTrig]);
265 trigNoPS.AddAt(histo,index);
267 selection = selectionCent; selection += Form(
"trigger:%s/%s/selected:yes", triggerName.Data(), selectRuns.Data());
268 histoName = histoNameBase;
269 histoName +=
"BWithPS";
270 histo = (
TH1*)
ProcessHisto(eventCounters,
"run", selection, histoName,
"",
"Trigger content w/ Phys. Sel.", colorInd[iTrig]);
271 trigWithPS.AddAt(histo,index);
273 selection = selectionCent; selection += Form(
"trigger:%s/%s/selected:yes/t0pileup:no", triggerName.Data(), selectRuns.Data());
274 histoName = histoNameBase;
275 histoName +=
"BWithPST0Flag";
276 histo = (
TH1*)
ProcessHisto(eventCounters,
"run", selection, histoName,
"",
"Trigger content w/ Phys. Sel. and no pile up from T0 flag", colorInd[iTrig]);
277 trigWithPST0Flag.AddAt(histo,index);
279 selection = selectionCent; selection += Form(
"trigger:%s/%s/selected:yes/t0pileup:no/spdpileup:no", triggerName.Data(), selectRuns.Data());
280 histoName = histoNameBase;
281 histoName +=
"BWithPST0SPDFlag";
282 histo = (
TH1*)
ProcessHisto(eventCounters,
"run", selection, histoName,
"",
"Trigger content w/ Phys. Sel. and no pile up from T0 and SPD flag", colorInd[iTrig]);
283 trigWithPST0SPDFlag.AddAt(histo,index);
286 selection = selectionCent; selection += Form(
"track:triggeronly/trigger:%s/%s/%s", triggerName.Data(), selectRuns.Data(), select.Data());
288 trackTrigger.AddAt(histo,index);
290 selection = selectionCent; selection += Form(
"track:trackeronly/trigger:%s/%s/%s", triggerName.Data(), selectRuns.Data(), select.Data());
292 trackTracker.AddAt(histo,index);
294 selection = selectionCent; selection += Form(
"track:matched/trigger:%s/%s/%s", triggerName.Data(), selectRuns.Data(), select.Data());
296 trackMatched.AddAt(histo,index);
298 histo = (
TH1*) ( (
TH1*) trackTrigger.At(index))->Clone(
"");
299 histo->Add( (
TH1*) trackTracker.At(index) );
300 histo->Add( (
TH1*) trackMatched.At(index) );
301 trackAll.AddAt(histo,index);
304 if ( iCentBin > 0 )
continue;
306 selection = selectionCent; selection += Form(
"track:matched/trigger:%s/%s/%s/pt:low/acc:in", triggerName.Data() ,selectRuns.Data(), select.Data());
308 trackMatchedLowPt.AddAt(histo,index);
310 selection = selectionCent; selection += Form(
"track:matched/trigger:%s/%s/%s/pt:high/acc:in", triggerName.Data() ,selectRuns.Data(), select.Data());
312 trackMatchedHighPt.AddAt(histo,index);
314 selection = selectionCent; selection += Form(
"track:matched/trigger:%s/%s/charge:pos/%s/acc:in",triggerName.Data(), select.Data(),selectRuns.Data());
316 trackPosMatched.AddAt(histo,index);
318 selection = selectionCent; selection += Form(
"track:matched/trigger:%s/%s/charge:neg/%s/acc:in",triggerName.Data(), select.Data(),selectRuns.Data());
320 trackNegMatched.AddAt(histo,index);
322 selection = selectionCent; selection += Form(
"track:matched/trigger:%s/%s/%s/acc:in",triggerName.Data(), select.Data(),selectRuns.Data());
324 trackAllMatched.AddAt(histo,index);
326 selection = selectionCent; selection += Form(
"track:matched/trigger:%s/%s/%s/acc:in/tagTrack:beamGas",triggerName.Data(), select.Data(),selectRuns.Data());
328 trackBeamGasMatched.AddAt(histo,index);
330 selection = selectionCent; selection += Form(
"track:matched/trigger:%s/%s/%s/acc:in/tagTrack:beamGas/pt:high",triggerName.Data(), select.Data(),selectRuns.Data());
332 trackBeamGasMatchedHighPt.AddAt(histo,index);
336 if ( selectPhysics) trigSel = trigWithPS;
337 else trigSel = trigNoPS;
340 Int_t count_trigger=0;
341 for(
Int_t iTrig = 0; iTrig < triggersB->GetEntriesFast(); iTrig++){
344 count_trigger += (
static_cast<TH1*
>(trigNoPS.At(index)))->GetEntries();
346 if(count_trigger<=0)
return;
348 Double_t NumOfBNoPS[nCentBin*nTrig];
349 Double_t NumOfBWithPS[nCentBin*nTrig];
351 for (
Int_t iCentBin = 0; iCentBin < nCentBin; iCentBin++){
352 for (
Int_t iTrig = 0; iTrig < nTrig; iTrig++){
354 NumOfBNoPS[index] = (
static_cast<TH1*
>(trigNoPS.At(index)))->Integral();
355 NumOfBWithPS[index] = (
static_cast<TH1*
>(trigWithPS.At(index)))->Integral();
359 cout<<
"//==================================================================================="<<endl;
360 cout<<
"// Put all plots in a ps file, easier to publish (Twiki)"<<endl;
361 cout<<
"//==================================================================================="<<endl;
363 c1->Print(OutFileNamePDF_open.Data());
364 TFile *rootFileOut = TFile::Open(OutFileNameROOT.Data(),
"RECREATE");
366 TDirectoryFile *dirGlobal =
new TDirectoryFile(
"Global",
"Global",
"",(TDirectory*)rootFileOut->GetMotherDir());
367 cout<<
"dirGlobal mother "<<(dirGlobal->GetMotherDir())->GetName()<<endl;
370 dirTrigger->SetOwner();
373 for (
Int_t i = 0; i < triggersB->GetEntriesFast()-1 ; i++) {
374 TString currTrigName = ( (TObjString*) triggersShortName->At(i) )->GetString();
375 TDirectoryFile *dirFile =
new TDirectoryFile( currTrigName.Data(),currTrigName.Data(),
"",(TDirectory*)rootFileOut->GetMotherDir() );
376 dirTrigger->AddLast( dirFile );
377 for(
Int_t j = 0; j < nCentBin; j++) {
378 TString centName = kCentLegendNameShort[j];
379 TDirectoryFile *dirFileCent =
new TDirectoryFile( centName.Data(),centName.Data(),
"",dirFile );
380 dirCent->AddLast( dirFileCent );
384 cAll->Print(OutFileNamePDF.Data());
388 cout<<
"//==================================================================================="<<endl;
389 cout<<
"// new canvas with the total number of trigger with and without Phys. Sel."<<endl;
390 cout<<
"//==================================================================================="<<endl;
393 cTriggerContent->Print(OutFileNamePDF.Data());
395 cTriggerContent->Write();
396 cTriggerContent->Close();
398 cout<<
"//==================================================================================="<<endl;
399 cout<<
"// new canvas with the relative content of each trigger w/o physics selection"<<endl;
400 cout<<
"//==================================================================================="<<endl;
403 cRelativeTriggerContent->Print(OutFileNamePDF.Data());
405 cRelativeTriggerContent->Write();
406 cRelativeTriggerContent->Close();
409 cout<<
"//==================================================================================="<<endl;
410 cout<<
"// new canvas with effect from physics selection for each trigger "<<endl;
411 cout<<
"//==================================================================================="<<endl;
413 TCanvas *cPhysSelCut = 0x0;
415 cPhysSelCut->Print(OutFileNamePDF.Data());
417 cPhysSelCut->Write();
418 cPhysSelCut->Close();
421 cout<<
"//==================================================================================="<<endl;
422 cout<<
"// new canvas with effect from T0 pile-up flag for each trigger "<<endl;
423 cout<<
"//==================================================================================="<<endl;
425 TCanvas *cPhysSelCutT0Flag = 0x0;
426 cPhysSelCutT0Flag =
ProcessCanvasPhysSelCut(triggersB, trigNoPS, trigWithPST0Flag,
"PhysSelCutOnCollTriggerT0Flag");
427 cPhysSelCutT0Flag->Print(OutFileNamePDF.Data());
429 cPhysSelCutT0Flag->Write();
430 cPhysSelCutT0Flag->Close();
434 cout<<
"//==================================================================================="<<endl;
435 cout<<
"// new canvas with effect from T0 + SPD pile-up flag for each trigger "<<endl;
436 cout<<
"//==================================================================================="<<endl;
438 TCanvas *cPhysSelCutT0SPDFlag = 0x0;
439 cPhysSelCutT0SPDFlag =
ProcessCanvasPhysSelCut(triggersB, trigNoPS, trigWithPST0SPDFlag,
"PhysSelCutOnCollTriggerT0SPDFlag");
440 cPhysSelCutT0SPDFlag->Print(OutFileNamePDF.Data());
442 cPhysSelCutT0SPDFlag->Write();
443 cPhysSelCutT0SPDFlag->Close();
452 cout<<
"//==================================================================================="<<endl;
453 cout<<
"// new canvas with effect from physics selection for each trigger and centrality bin (only in heavy-ion) "<<endl;
454 cout<<
"//==================================================================================="<<endl;
456 TCanvas *cPhysSelCutCentrality;
459 for(
Int_t iTrig = 0; iTrig < triggersB->GetEntriesFast(); iTrig++){
461 if(iTrig == (triggersB->GetEntriesFast()-1))
continue;
463 canvasName =
"PhysSel_trigger";
464 canvasName += ( (TObjString*) triggersShortName->At(iTrig) )->GetString();
467 cPhysSelCutCentrality->Print(OutFileNamePDF.Data());
468 ( (TDirectoryFile*) dirTrigger->At(iTrig) )->cd();
469 cPhysSelCutCentrality->Write();
470 cPhysSelCutCentrality->Close();
476 cout<<
"//==================================================================================="<<endl;
477 cout<<
"// new canvas for centrality percentile check (only in PbPb) "<<endl;
478 cout<<
"//==================================================================================="<<endl;
480 TCanvas *cCentralityCheck;
483 for (
Int_t iTrig = 0; iTrig < triggersB->GetEntriesFast(); iTrig++){
485 if ( iTrig == (triggersB->GetEntriesFast()-1) )
continue;
487 canvasName =
"CentralityCheck_trigger";
488 canvasName += ( (TObjString*) triggersShortName->At(iTrig) )->GetString();
492 cCentralityCheck->Print(OutFileNamePDF.Data());
493 ( (TDirectoryFile*) dirTrigger->At(iTrig) )->cd();
494 cCentralityCheck->Write();
495 cCentralityCheck->Close();
501 cout<<
"//==================================================================================="<<endl;
502 cout<<
"// Ratio of tracks over trigger type (2 canvases) "<<endl;
503 cout<<
"//==================================================================================="<<endl;
506 TCanvas *cTracksoverTrigger;
507 TCanvas* cTrackMultB;
510 for (
Int_t iCentBin = 0; iCentBin < nCentBin; iCentBin++){
512 legendHeader =
"for ";
513 legendHeader += kCentLegendName[iCentBin];
515 else legendHeader =
"";
517 for(
Int_t iTrig = 0; iTrig < triggersB->GetEntriesFast(); iTrig++){
519 if( iTrig == (triggersB->GetEntriesFast()-1) )
continue;
521 ( (TDirectoryFile*) dirCent->At( iTrig*nCentBin+iCentBin ) )->cd();
523 canvasName =
"RatioTrackTypes_cent";
524 canvasName += iCentBin;
525 canvasName +=
"trigger";
526 canvasName += ( (TObjString*) triggersShortName->At(iTrig) )->GetString();
527 cTracksoverTrigger =
ProcessCanvasTracksoverTrigger(triggersB, trigSel, trackTracker, trackTrigger, trackMatched, trackAll, iTrig, iCentBin, canvasName,legendHeader);
528 cTracksoverTrigger->Print(OutFileNamePDF.Data());
529 cTracksoverTrigger->Write();
530 cTracksoverTrigger->Close();
532 canvasName =
"TrackMult_cent";
533 canvasName += iCentBin;
534 canvasName +=
"trigger";
535 canvasName +=( (TObjString*) triggersShortName->At(iTrig) )->GetString();
536 cTrackMultB=
ProcessCanvasTrackMultB(triggersB, trigSel, trackTracker, trackTrigger, trackMatched, iTrig, iCentBin, canvasName, legendHeader);
537 cTrackMultB->Print(OutFileNamePDF.Data());
538 cTrackMultB->Write();
539 cTrackMultB->Close();
544 cout<<
"//===================================================="<<endl;
545 cout<<
"// Draw matched tracks asymmetry for each trigger "<<endl;
546 cout<<
"//===================================================="<<endl;
549 TCanvas *cAsymMatched;
551 legendHeader =
"for all collisions";
552 for (
Int_t iTrig = 0; iTrig < triggersB->GetEntriesFast(); iTrig++){
554 if ( iTrig == (triggersB->GetEntriesFast()-1) )
continue;
556 ( (TDirectoryFile*) dirTrigger->At( iTrig ) )->cd();
558 canvasName =
"AsymMatched";
559 canvasName +=
"trigger";
560 canvasName +=( (TObjString*) triggersShortName->At(iTrig) )->GetString();
562 cAsymMatched =
ProcessCanvasAsymMatched(triggersB, trackPosMatched, trackNegMatched, trackAllMatched, iTrig, iCentBin, canvasName,legendHeader);
563 cAsymMatched->Print(OutFileNamePDF.Data());
564 cAsymMatched->Write();
565 cAsymMatched->Close();
570 cout<<
"//===================================================================="<<endl;
571 cout<<
"// Draw beam gas contribution to matched tracks for each trigger "<<endl;
572 cout<<
"//===================================================================="<<endl;
575 TCanvas *cBeamGasMatched;
578 for (
Int_t iTrig = 0; iTrig < triggersB->GetEntriesFast(); iTrig++){
580 if ( iTrig == (triggersB->GetEntriesFast()-1))
continue;
582 ( (TDirectoryFile*) dirTrigger->At(iTrig) )->cd();
583 canvasName =
"BeamGasMatched";
584 canvasName +=
"trigger";
585 canvasName +=( (TObjString*) triggersShortName->At(iTrig) )->GetString();
587 cBeamGasMatched=
ProcessCanvasBeamGasMatched(triggersB, trackBeamGasMatched, trackBeamGasMatchedHighPt, trackAllMatched, trackMatchedHighPt, iTrig, iCentBin, canvasName,legendHeader);
588 cBeamGasMatched->Print(OutFileNamePDF.Data());
589 cBeamGasMatched->Write();
590 cBeamGasMatched->Close();
594 cout<<
"//=================================================="<<endl;
595 cout<<
"// Draw high pt tracks per trigger"<<endl;
596 cout<<
"//=================================================="<<endl;
599 TCanvas *cHighPtMuons;
600 legendHeader =
"for all collisions";
602 for (
Int_t iTrig = 0; iTrig < triggersB->GetEntriesFast(); iTrig++){
604 if( iTrig == (triggersB->GetEntriesFast()-1))
continue;
606 ( (TDirectoryFile*) dirTrigger->At( iTrig ) )->cd();
608 canvasName =
"HighPtMuons";
609 canvasName +=
"trigger";
610 canvasName +=( (TObjString*) triggersShortName->At(iTrig) )->GetString();
613 cHighPtMuons =
ProcessCanvasHighPtMuons(triggersB, trigSel, trackMatchedLowPt, trackMatchedHighPt, iTrig, iCentBin, canvasName,legendHeader);
614 cHighPtMuons->Print(OutFileNamePDF.Data());
615 cHighPtMuons->Write();
616 cHighPtMuons->Close();
627 cout << endl << endl;
630 if ( triggersB->At(kCMUS) ) {
634 THashList* labels = (
static_cast<TH1*
>(trigWithPS.At(triggersB->GetEntriesFast()*centBinNr+kCMUS)))->GetXaxis()->GetLabels();
639 TObjString* label = 0x0;
640 TIter nextLabel(labels);
641 cout <<
"-------------------------------------------------" << endl;
642 cout <<
"Run Number" <<
"\t Number of "<< ( (TObjString*) triggersB->At(kCMUS) )->GetString()<<
" after Phys. Sel. " << endl ;
643 while ((label = static_cast<TObjString*>(nextLabel()))) {
646 printf(format.Data(), label->String().Data(), (
Int_t) (static_cast<TH1*>(trigWithPS.At(triggersB->GetEntriesFast()*centBinNr+kCMUS)))->GetBinContent(bin));
648 printf(
"\n========== Total #runs = %d ==============\n",nRuns);
652 cout <<
"-------------------------------------------------" << endl;
653 cout <<
"Total statistic" << endl;
654 cout <<
" " << endl ;
656 cout <<
"-------------------------------------------------------------------" << endl;
657 cout<<
"Number of triggers w/o Phys. Sel./ w/ Phys. Sel (Phys. Sel. cut in %)"<<endl;
658 for(
Int_t iTrig = 0; iTrig < triggersB->GetEntriesFast()-1; iTrig++){
659 TString triggerNameB = ( (TObjString*) triggersB->At(iTrig) )->GetString();
662 printf(
"%10s\t",triggerNameB.Data());
664 if(NumOfBNoPS[index] > 0.) cutinpercent = (NumOfBNoPS[index]-NumOfBWithPS[index])/NumOfBNoPS[index]*100.;
665 printf(
"%g / %g (%g%%)\n", NumOfBNoPS[index],NumOfBWithPS[index],cutinpercent);
682 Int_t const nMuonTriggerCase = 7;
683 TH1F *hMuonTrigger[nMuonTriggerCase];
684 TString muonTriggerName[nMuonTriggerCase] = {
"Unlike-only",
"Like-only",
"Hpt-only",
"Unlike&Like",
"Unlike&Hpt",
"Like&Hpt",
"Unlike&Like&Hpt"};
685 for (
Int_t i = 0; i < nMuonTriggerCase; i++ ) {
686 hMuonTrigger[i] =
new TH1F(Form(
"hMuonTrigger_%s", muonTriggerName[i].
Data()),Form(
"Trigger %s per run",muonTriggerName[i].
Data()),10000,1,10000);
689 TH1F* hTriggerCutVsRun[2], *hTriggerCutWidthVsRun[2];
690 for (
Int_t ihisto=0; ihisto<2; ++ihisto ) {
691 TString cutName = ( ihisto == 0 ) ?
"Lpt" :
"Hpt";
692 hTriggerCutVsRun[ihisto] =
new TH1F(Form(
"hTriggerCutVsRun%s", cutName.Data()), Form(
"Trigger %s cut per run", cutName.Data()), 10000,1,10000);
693 hTriggerCutWidthVsRun[ihisto] = (TH1F*)hTriggerCutVsRun[ihisto]->Clone(Form(
"hTriggerCutWidthVsRun%s", cutName.Data()));
695 TF1* fitMatchTrig =
new TF1(
"fitMatchTrig",
"[3] + [0] * ( 1. + TMath::Erf((x - [1]) / [2] / TMath::Sqrt(2.)))", 0.1, 6.);
696 TH1F* hNClustersPerTrackVsRun_Mean =
new TH1F(
"hNClustersPerTrackVsRun_Mean",
"averaged number of associated clusters per track;run;<n_{clusters}>",10000,1,10000);
697 TH1F* hNClustersPerTrackVsRun_Sigma =
new TH1F(
"hNClustersPerTrackVsRun_Sigma",
"dispersion of the number of associated clusters per track;run;#sigma_{n_{clusters}}",10000,1,10000);
698 TH1F* hNChamberHitPerTrack_Mean =
new TH1F(
"hNChamberHitPerTrack_Mean",
"averaged number of chambers hit per track;run;<n_{chamber hit}>",10000,1,10000);
699 TH1F* hNChamberHitPerTrack_Sigma =
new TH1F(
"hNChamberHitPerTrack_Sigma",
"dispersion of the number of chambers hit per track;run;#sigma_{n_{chamber hit}}",10000,1,10000);
700 TH1F* hChi2_Mean =
new TH1F(
"hChi2_Mean",
"averaged normalized #chi^{2} distribution;run;<#chi^{2} / ndf>",10000,1,10000);
701 TH1F* hChi2_Sigma =
new TH1F(
"hChi2_Sigma",
"dispersion of normalized #chi^{2} distribution;run;#sigma_{#chi^{2} / ndf}",10000,1,10000);
702 TH1F* hNClustersInCh[10];
703 for (
Int_t ich=0; ich<10; ich++){
704 hNClustersInCh[ich] =
new TH1F(Form(
"hNClustersInCh%d",ich+1), Form(
"averaged number of clusters in chamber %d per track;run;<n_{clusters}>",ich+1),10000,1,10000);
706 TH1F* hClusterChargeMeanInCh[10], *hClusterChargeSigmaInCh[10];
707 for (
Int_t ich=0; ich<10; ich++){
708 hClusterChargeMeanInCh[ich] =
new TH1F(Form(
"hClusterChargeMeanInCh%d",ich+1), Form(
"averaged cluster charge -mean- per track in chamber %d",ich+1),10000,1,10000);
709 hClusterChargeSigmaInCh[ich] =
new TH1F(Form(
"hClusterChargeSigmaInCh%d",ich+1), Form(
"averaged cluster charge -sigma- per track in chamber %d",ich+1),10000,1,10000);
711 TH1F* hClusterSizeMeanInCh[10], *hClusterSizeSigmaInCh[10];
712 for (
Int_t ich=0; ich<10; ich++){
713 hClusterSizeMeanInCh[ich] =
new TH1F(Form(
"hClusterSizeMeanInCh%d",ich+1), Form(
"averaged cluster size -mean- per track in chamber %d",ich+1),10000,1,10000);
714 hClusterSizeSigmaInCh[ich] =
new TH1F(Form(
"hClusterSizeSigmaInCh%d",ich+1), Form(
"averaged cluster size -sigma- per track in chamber %d",ich+1),10000,1,10000);
717 TH1F* hClusterHitMapXInCh[10];
718 for (
Int_t ich=0; ich<10; ich++){
719 hClusterHitMapXInCh[ich] =
new TH1F(Form(
"hClusterHitMapXInCh%d",ich+1), Form(
"averaged cluster position distribution in chamber %d;X (cm)",ich+1),10000,1,10000);
721 TH1F* hClusterHitMapYInCh[10];
722 for (
Int_t ich=0; ich<10; ich++){
723 hClusterHitMapYInCh[ich] =
new TH1F(Form(
"hClusterHitMapYInCh%d",ich+1), Form(
"averaged cluster position distribution in chamber %d;Y (cm)",ich+1),10000,1,10000);
730 Int_t isAlienFile = 0;
731 if(alienBaseDir.Contains(
"alien:")){
733 alienBaseDir.ReplaceAll(
"alien://",
"");
736 cout<<
"============================================================"<<endl;
737 cout<<
"Monitoring quantities run per run: loop over "<<runs->GetEntriesFast()<<
" runs."<<endl;
738 cout<<
" directory = "<<alienBaseDir.Data()<<endl;
739 cout<<
"============================================================"<<endl;
742 for (
Int_t irun=0; irun<runs->GetEntriesFast(); irun++ ) {
744 TString run = ((TObjString*)runs->UncheckedAt(irun))->GetString();
748 TGridResult *res = 0;
751 command = Form(
"find %s/ %s/%s", alienBaseDir.Data(), run.Data(), QAFileName);
752 res = gGrid->Command(command);
754 Error(
"PlotMuonQA",
"no result for the command: %s",command.Data());
759 res =
new TGridResult();
761 command = Form(
"find %s/*%s/ -name %s | xargs", alienBaseDir.Data(), run.Data(), QAFileName);
763 TObjArray* arr = foundFiles.Tokenize(
" ");
765 for (
Int_t iarr=0; iarr<arr->GetEntries(); iarr++ ) {
766 res->Add(
new TObjString(arr->At(iarr)->GetName()));
773 TObjString *objs = 0;
775 Bool_t searchRunNr = kFALSE;
776 if ( !isAlienFile && run.Contains(
"*") ) searchRunNr = kTRUE;
779 while ( ( currObj = nextmap() ) ){
783 objs =
static_cast<TObjString*
>(
static_cast<TMap*
>(currObj)->GetValue(
"turl"));
786 objs=
static_cast<TObjString*
>(currObj);
789 if (objs->GetString().IsNull()) {
790 Error(
"PlotMuonQA",
"turl/obj not found for the run %s... SKIPPING", run.Data());
796 if (runNr > 0) run = Form(
"%i",runNr);
799 if ( run.IsDigit() && ! selectRuns.Contains(Form(
"%i",run.Atoi())) )
continue;
802 TFile *runFile = TFile::Open(objs->GetString());
803 if (!runFile || ! runFile->IsOpen()) {
804 Error(
"PlotMuonQA",
"failed to open file: %s", objs->GetName());
807 runFile->Cd(
"MUON_QA");
814 if (!general1 || !general2 || !expert){
815 Error(
"PlotMuonQA",
"All objects not here !!! ===> Skipping...for %s",objs->GetName());
819 TH1* hNClustersPerTrack =
static_cast<TH1*
>(general1->FindObject(
"hNClustersPerTrack"));
820 TH1* hNChamberHitPerTrack =
static_cast<TH1*
>(general1->FindObject(
"hNChamberHitPerTrack"));
821 TH1* hChi2 =
static_cast<TH1*
>(general1->FindObject(
"hChi2"));
822 TH1* hNClustersPerCh =
static_cast<TH1*
>(general2->FindObject(
"hNClustersPerCh"));
823 TH1 *hClusterChargePerChMean =
static_cast<TH1*
>(general2->FindObject(
"hClusterChargePerChMean"));
824 TH1 *hClusterChargePerChSigma =
static_cast<TH1*
>(general2->FindObject(
"hClusterChargePerChSigma"));
825 TH1 *hClusterSizePerChMean =
static_cast<TH1*
>(general2->FindObject(
"hClusterSizePerChMean"));
826 TH1 *hClusterSizePerChSigma =
static_cast<TH1*
>(general2->FindObject(
"hClusterSizePerChSigma"));
827 TH1* hMuonTriggers =
static_cast<TH1*
>(general1->FindObject(
"hMuonTriggers"));
828 for (
Int_t ihisto=0; ihisto<nMuonTriggerCase; ihisto++){
830 if ( hMuonTriggers ) val = hMuonTriggers->GetBinContent(ihisto+2);
831 if ( hMuonTrigger[ihisto]->GetSumw2N() == 0 ) hMuonTrigger[ihisto]->Sumw2();
832 hMuonTrigger[ihisto]->SetBinContent(ibin,val);
833 hMuonTrigger[ihisto]->SetBinError(ibin,TMath::Sqrt(val));
834 hMuonTrigger[ihisto]->GetXaxis()->SetBinLabel(ibin,run.Data());
836 TH1* hPtDistrib =
static_cast<TH1*
>(general1->FindObject(
"hPt"));
837 TH1* hPtDistribLpt =
static_cast<TH1*
>(general1->FindObject(
"hPtMatchLpt"));
838 TH1* hPtDistribHpt =
static_cast<TH1*
>(general1->FindObject(
"hPtMatchHpt"));
839 if ( hPtDistrib && hPtDistribLpt && hPtDistribHpt ) {
840 if ( hPtDistrib->GetSumw2N() == 0 ) hPtDistrib->Sumw2();
841 TH1* histoMatch[2] = {hPtDistribLpt, hPtDistribHpt};
842 for (
Int_t ihisto=0; ihisto<2; ++ihisto ) {
843 if ( histoMatch[ihisto]->GetSumw2N() == 0 ) histoMatch[ihisto]->Sumw2();
844 if ( histoMatch[ihisto]->GetEntries() == 0 )
continue;
845 histoMatch[ihisto]->Divide(hPtDistrib);
846 Double_t minEff = 99999., maxEff = -1.;
849 Int_t ptBinLow = histoMatch[ihisto]->GetXaxis()->FindBin(ptMinFit);
850 Int_t ptBinHigh = histoMatch[ihisto]->GetXaxis()->FindBin(ptMaxFit);
851 for (
Int_t currBin=ptBinLow; currBin<=ptBinHigh; currBin++ ) {
852 Double_t currEff = histoMatch[ihisto]->GetBinContent(currBin);
853 Double_t currPt = histoMatch[ihisto]->GetXaxis()->GetBinCenter(currBin);
854 if ( currPt < 1.5 && minEff > currEff ) {
858 if ( currPt > 0.5 && maxEff < currEff ) {
863 fitMatchTrig->SetParameters(0.5, 0.5, 0.8, 0.2);
864 fitMatchTrig->SetParLimits(0,0.,1.);
865 fitMatchTrig->SetParLimits(1,0.,5.);
866 fitMatchTrig->SetParLimits(2,0.,5.);
867 fitMatchTrig->SetParLimits(3,0.,0.5);
868 histoMatch[ihisto]->Fit(fitMatchTrig,
"RQ0",
"",ptMinFit,ptMaxFit);
869 Double_t ptCut = fitMatchTrig->GetParameter(1);
870 Double_t ptCutErr = fitMatchTrig->GetParError(1);
871 Double_t ptCutWidth = fitMatchTrig->GetParameter(2);
872 if ( ptCut < 0 || ptCut > 10. ) {
873 ptCut = ptCutErr = ptCutWidth = 0.;
875 hTriggerCutVsRun[ihisto]->SetBinContent(ibin, ptCut);
876 hTriggerCutVsRun[ihisto]->SetBinError(ibin, ptCutErr);
877 hTriggerCutWidthVsRun[ihisto]->SetBinContent(ibin, ptCut);
878 hTriggerCutWidthVsRun[ihisto]->SetBinError(ibin, ptCutWidth);
881 TH2* hClusterHitMapInCh[10];
882 for(
Int_t ich=0; ich<10; ich++) hClusterHitMapInCh[ich] = static_cast<TH2*>(expert->FindObject(Form(
"hClusterHitMapInCh%d",ich+1)));
884 if (!hNClustersPerCh) {
885 Warning(
"PlotMUONQA",
"File: %s has empty histograms !", objs->GetName());
886 hNClustersPerTrackVsRun_Mean->SetBinContent(ibin, 0.);
887 hNClustersPerTrackVsRun_Mean->SetBinError(ibin, 1.);
888 hNClustersPerTrackVsRun_Sigma->SetBinContent(ibin, 0.);
889 hNClustersPerTrackVsRun_Sigma->SetBinError(ibin, 1.);
890 hNChamberHitPerTrack_Mean->SetBinContent(ibin, 0.);
891 hNChamberHitPerTrack_Mean->SetBinError(ibin, 1.);
892 hNChamberHitPerTrack_Sigma->SetBinContent(ibin, 0.);
893 hNChamberHitPerTrack_Sigma->SetBinError(ibin, 1.);
894 hChi2_Mean->SetBinContent(ibin, 0.);
895 hChi2_Mean->SetBinError(ibin, 1.);
896 hChi2_Sigma->SetBinContent(ibin, 0.);
897 hChi2_Sigma->SetBinError(ibin, 1.);
898 for (
Int_t ich=0; ich<10; ich++) {
899 hNClustersInCh[ich]->SetBinContent(ibin,0.);
900 hNClustersInCh[ich]->SetBinError(ibin,1.);
901 hClusterHitMapXInCh[ich]->SetBinContent(ibin,0.);
902 hClusterHitMapXInCh[ich]->SetBinError(ibin,1.);
903 hClusterHitMapYInCh[ich]->SetBinContent(ibin,0.);
904 hClusterHitMapYInCh[ich]->SetBinError(ibin,1.);
911 hNClustersPerTrackVsRun_Mean->SetBinContent(ibin, hNClustersPerTrack->GetMean());
912 hNClustersPerTrackVsRun_Mean->SetBinError(ibin, hNClustersPerTrack->GetMeanError());
913 hNClustersPerTrackVsRun_Sigma->SetBinContent(ibin, hNClustersPerTrack->GetRMS());
914 hNClustersPerTrackVsRun_Sigma->SetBinError(ibin, hNClustersPerTrack->GetRMSError());
915 hNChamberHitPerTrack_Mean->SetBinContent(ibin, hNChamberHitPerTrack->GetMean());
916 hNChamberHitPerTrack_Mean->SetBinError(ibin, hNChamberHitPerTrack->GetMeanError());
917 hNChamberHitPerTrack_Sigma->SetBinContent(ibin, hNChamberHitPerTrack->GetRMS());
918 hNChamberHitPerTrack_Sigma->SetBinError(ibin, hNChamberHitPerTrack->GetRMSError());
919 hChi2_Mean->SetBinContent(ibin, hChi2->GetMean());
920 hChi2_Mean->SetBinError(ibin, hChi2->GetMeanError());
921 hChi2_Sigma->SetBinContent(ibin, hChi2->GetRMS());
922 hChi2_Sigma->SetBinError(ibin, hChi2->GetRMSError());
923 for (
Int_t ich=0; ich<10; ich++) {
924 hNClustersInCh[ich]->SetBinContent(ibin,hNClustersPerCh->GetBinContent(ich+1));
925 hNClustersInCh[ich]->SetBinError(ibin,hNClustersPerCh->GetBinError(ich+1));
926 hClusterChargeMeanInCh[ich]->SetBinContent(ibin,hClusterChargePerChMean->GetBinContent(ich+1));
927 hClusterChargeMeanInCh[ich]->SetBinError(ibin,hClusterChargePerChMean->GetBinError(ich+1));
928 hClusterChargeSigmaInCh[ich]->SetBinContent(ibin,hClusterChargePerChSigma->GetBinContent(ich+1));
929 hClusterChargeSigmaInCh[ich]->SetBinError(ibin,hClusterChargePerChSigma->GetBinError(ich+1));
930 hClusterSizeMeanInCh[ich]->SetBinContent(ibin,hClusterSizePerChMean->GetBinContent(ich+1));
931 hClusterSizeMeanInCh[ich]->SetBinError(ibin,hClusterSizePerChMean->GetBinError(ich+1));
932 hClusterSizeSigmaInCh[ich]->SetBinContent(ibin,hClusterSizePerChSigma->GetBinContent(ich+1));
933 hClusterSizeSigmaInCh[ich]->SetBinError(ibin,hClusterSizePerChSigma->GetBinError(ich+1));
934 hNClustersInCh[ich]->SetBinContent(ibin,hNClustersPerCh->GetBinContent(ich+1));
935 hNClustersInCh[ich]->SetBinError(ibin,hNClustersPerCh->GetBinError(ich+1));
936 hClusterHitMapXInCh[ich]->SetBinContent(ibin,hClusterHitMapInCh[ich]->GetMean(1));
937 hClusterHitMapXInCh[ich]->SetBinError(ibin,hClusterHitMapInCh[ich]->GetMeanError(1));
938 hClusterHitMapYInCh[ich]->SetBinContent(ibin,hClusterHitMapInCh[ich]->GetMean(2));
939 hClusterHitMapYInCh[ich]->SetBinError(ibin,hClusterHitMapInCh[ich]->GetMeanError(2));
944 for (
Int_t ihisto=0; ihisto<2; ++ihisto ) {
945 hTriggerCutVsRun[ihisto]->GetXaxis()->SetBinLabel(ibin,run.Data());
946 hTriggerCutWidthVsRun[ihisto]->GetXaxis()->SetBinLabel(ibin,run.Data());
948 hNClustersPerTrackVsRun_Mean->GetXaxis()->SetBinLabel(ibin, run.Data());
949 hNClustersPerTrackVsRun_Sigma->GetXaxis()->SetBinLabel(ibin, run.Data());
950 hNChamberHitPerTrack_Mean->GetXaxis()->SetBinLabel(ibin, run.Data());
951 hNChamberHitPerTrack_Sigma->GetXaxis()->SetBinLabel(ibin, run.Data());
952 hChi2_Mean->GetXaxis()->SetBinLabel(ibin, run.Data());
953 hChi2_Sigma->GetXaxis()->SetBinLabel(ibin, run.Data());
954 for (
Int_t ich=0; ich<10; ich++){
955 hNClustersInCh[ich]->GetXaxis()->SetBinLabel(ibin, run.Data());
956 hClusterChargeMeanInCh[ich]->GetXaxis()->SetBinLabel(ibin, run.Data());
957 hClusterChargeSigmaInCh[ich]->GetXaxis()->SetBinLabel(ibin, run.Data());
958 hClusterSizeMeanInCh[ich]->GetXaxis()->SetBinLabel(ibin, run.Data());
959 hClusterSizeSigmaInCh[ich]->GetXaxis()->SetBinLabel(ibin, run.Data());
960 hClusterHitMapXInCh[ich]->GetXaxis()->SetBinLabel(ibin, run.Data());
961 hClusterHitMapYInCh[ich]->GetXaxis()->SetBinLabel(ibin, run.Data());
973 hNClustersPerTrackVsRun_Mean->LabelsOption(
"a");
974 hNClustersPerTrackVsRun_Sigma->LabelsOption(
"a");
975 hNChamberHitPerTrack_Mean->LabelsOption(
"a");
976 hNChamberHitPerTrack_Sigma->LabelsOption(
"a");
977 hChi2_Mean->LabelsOption(
"a");
978 hChi2_Sigma->LabelsOption(
"a");
980 for(
Int_t ich=0; ich<10; ich++){
981 hNClustersInCh[ich]->LabelsOption(
"a");
982 hClusterChargeMeanInCh[ich]->LabelsOption(
"a");
983 hClusterChargeSigmaInCh[ich]->LabelsOption(
"a");
984 hClusterSizeMeanInCh[ich]->LabelsOption(
"a");
985 hClusterSizeSigmaInCh[ich]->LabelsOption(
"a");
986 hClusterHitMapXInCh[ich]->LabelsOption(
"a");
987 hClusterHitMapYInCh[ich]->LabelsOption(
"a");
990 TString dirToGo = OutFileNameROOT.Data(); dirToGo+=
":/";
991 gDirectory->Cd(dirToGo.Data());
992 cout<<
"=================================================="<<endl;
993 cout<<
"Display Mean and Sigma of the number of associated clusters to a track "<<endl;
994 cout<<
"=================================================="<<endl;
995 TLegend *lNClusters =
new TLegend(0.75,0.85,0.99,0.99);
996 lNClusters->AddEntry(hNClustersPerTrackVsRun_Mean,
"clusters",
"PL");
997 lNClusters->AddEntry(hNChamberHitPerTrack_Mean,
"chamber hit",
"PL");
999 TCanvas* cNClusters =
new TCanvas(
"cNClusters",
"cNClusters",1200,900);
1000 cNClusters->Divide(1,2);
1003 hNClustersPerTrackVsRun_Mean->SetMinimum(7);
1004 hNClustersPerTrackVsRun_Mean->SetStats(kFALSE);
1005 hNClustersPerTrackVsRun_Mean->GetXaxis()->SetRange(1,ibin-1);
1006 hNClustersPerTrackVsRun_Mean->GetXaxis()->SetNdivisions(1,kFALSE);
1008 hNClustersPerTrackVsRun_Mean->SetLabelSize(0.04);
1009 hNClustersPerTrackVsRun_Mean->SetTitle(
"averaged number of associated clusters or of the number of chamber hit per track");
1010 hNClustersPerTrackVsRun_Mean->SetLineWidth(2);
1011 hNClustersPerTrackVsRun_Mean->Draw(
"e");
1012 hNChamberHitPerTrack_Mean->SetLineColor(kRed);
1013 hNChamberHitPerTrack_Mean->SetLineWidth(2);
1014 hNChamberHitPerTrack_Mean->Draw(
"esame");
1015 lNClusters->Draw(
"same");
1019 hNClustersPerTrackVsRun_Sigma->SetMinimum(0.4);
1020 hNClustersPerTrackVsRun_Sigma->SetStats(kFALSE);
1021 hNClustersPerTrackVsRun_Sigma->GetXaxis()->SetRange(1,ibin-1);
1022 hNClustersPerTrackVsRun_Sigma->GetXaxis()->SetNdivisions(1,kFALSE);
1024 hNClustersPerTrackVsRun_Sigma->SetLabelSize(0.04);
1025 hNClustersPerTrackVsRun_Sigma->SetTitle(
"dispersion of the number of associated clusters or of the number of chamber hit per track");
1026 hNClustersPerTrackVsRun_Sigma->SetLineWidth(2);
1027 hNClustersPerTrackVsRun_Sigma->Draw(
"e");
1028 hNChamberHitPerTrack_Sigma->SetLineWidth(2);
1029 hNChamberHitPerTrack_Sigma->SetLineColor(kRed);
1030 hNChamberHitPerTrack_Sigma->Draw(
"esame");
1031 lNClusters->Draw(
"same");
1033 cNClusters->Print(OutFileNamePDF.Data());
1035 cNClusters->Write();
1037 cout<<
"=================================================="<<endl;
1038 cout<<
" Display average number of cluster per chamber "<<endl;
1039 cout<<
"=================================================="<<endl;
1041 TLegend *lNClustersPerCh =
new TLegend(0.92,0.45,0.99,0.99);
1042 TCanvas* cNClustersPerCh =
new TCanvas(
"cNClustersPerCh",
"cNClustersPerCh",1200,900);
1043 cNClustersPerCh->cd();
1044 cNClustersPerCh->SetRightMargin(0.1);
1045 hNClustersInCh[0]->SetStats(kFALSE);
1046 hNClustersInCh[0]->GetXaxis()->SetRange(1,ibin-1);
1047 hNClustersInCh[0]->GetXaxis()->SetNdivisions(1,kFALSE);
1049 hNClustersInCh[0]->SetLabelSize(0.02);
1050 hNClustersInCh[0]->SetTitle(
"averaged number of clusters in chamber i per track");
1051 hNClustersInCh[0]->SetMaximum(1.2);
1052 hNClustersInCh[0]->SetMinimum(0.01);
1053 for (
Int_t ich=0; ich<10; ich++) {
1054 hNClustersInCh[ich]->SetLineColor(ich+1+ich/9);
1055 hNClustersInCh[ich]->SetLineWidth(2);
1056 if (ich == 0) hNClustersInCh[ich]->Draw(
"e");
1057 else hNClustersInCh[ich]->Draw(
"esame");
1058 lNClustersPerCh->AddEntry(hNClustersInCh[ich],Form(
"ch%d",ich+1),
"PL");
1060 lNClustersPerCh->Draw(
"same");
1062 cNClustersPerCh->Print(OutFileNamePDF.Data());
1064 cNClustersPerCh->Write();
1066 cout<<
"=================================================="<<endl;
1067 cout<<
" Display average cluster charge per chamber "<<endl;
1068 cout<<
"=================================================="<<endl;
1070 TLegend *lClusterChargePerCh =
new TLegend(0.92,0.45,0.99,0.99);
1071 TCanvas* cClusterChargePerCh =
new TCanvas(
"cClustersChargePerCh",
"cClustersChargePerCh",1200,900);
1072 cClusterChargePerCh->SetRightMargin(0.1);
1073 cClusterChargePerCh->Divide(1,2);
1075 cClusterChargePerCh->cd(1);
1076 hClusterChargeMeanInCh[0]->SetStats(kFALSE);
1077 hClusterChargeMeanInCh[0]->GetXaxis()->SetRange(1,ibin-1);
1078 hClusterChargeMeanInCh[0]->GetXaxis()->SetNdivisions(1,kFALSE);
1080 hClusterChargeMeanInCh[0]->SetLabelSize(0.04);
1081 hClusterChargeMeanInCh[0]->SetTitle(
"Cluster charge mean (fC) per track in chamber i");
1082 hClusterChargeMeanInCh[0]->SetMaximum(150);
1083 hClusterChargeMeanInCh[0]->SetMinimum(30);
1084 for (
Int_t ich=0; ich<10; ich++) {
1085 hClusterChargeMeanInCh[ich]->SetLineColor(ich+1+ich/9);
1086 hClusterChargeMeanInCh[ich]->SetLineWidth(2);
1087 if (ich == 0) hClusterChargeMeanInCh[ich]->Draw(
"e");
1088 else hClusterChargeMeanInCh[ich]->Draw(
"esame");
1089 lClusterChargePerCh->AddEntry(hClusterChargeMeanInCh[ich],Form(
"ch%d",ich+1),
"PL");
1091 lClusterChargePerCh->Draw(
"same");
1093 cClusterChargePerCh->cd(2);
1094 hClusterChargeSigmaInCh[0]->SetStats(kFALSE);
1095 hClusterChargeSigmaInCh[0]->GetXaxis()->SetRange(1,ibin-1);
1096 hClusterChargeSigmaInCh[0]->GetXaxis()->SetNdivisions(1,kFALSE);
1098 hClusterChargeSigmaInCh[0]->SetLabelSize(0.04);
1099 hClusterChargeSigmaInCh[0]->SetTitle(
"Cluster charge sigma per track in chamber i");
1100 hClusterChargeSigmaInCh[0]->SetMaximum(250);
1101 hClusterChargeSigmaInCh[0]->SetMinimum(50);
1102 for (
Int_t ich=0; ich<10; ich++) {
1103 hClusterChargeSigmaInCh[ich]->SetLineColor(ich+1+ich/9);
1104 hClusterChargeSigmaInCh[ich]->SetLineWidth(2);
1105 if (ich == 0) hClusterChargeSigmaInCh[ich]->Draw(
"e");
1106 else hClusterChargeSigmaInCh[ich]->Draw(
"esame");
1108 lClusterChargePerCh->Draw(
"same");
1110 cClusterChargePerCh->Print(OutFileNamePDF.Data());
1112 cClusterChargePerCh->Write();
1114 cout<<
"=================================================="<<endl;
1115 cout<<
" Display average cluster size per chamber "<<endl;
1116 cout<<
"=================================================="<<endl;
1118 TLegend *lClusterSizePerCh =
new TLegend(0.92,0.45,0.99,0.99);
1119 TCanvas* cClusterSizePerCh =
new TCanvas(
"cClustersSizePerCh",
"cClustersSizePerCh",1200,900);
1120 cClusterSizePerCh->SetRightMargin(0.1);
1121 cClusterSizePerCh->Divide(1,2);
1123 cClusterSizePerCh->cd(1);
1124 hClusterSizeMeanInCh[0]->SetStats(kFALSE);
1125 hClusterSizeMeanInCh[0]->GetXaxis()->SetRange(1,ibin-1);
1126 hClusterSizeMeanInCh[0]->GetXaxis()->SetNdivisions(1,kFALSE);
1128 hClusterSizeMeanInCh[0]->SetLabelSize(0.04);
1129 hClusterSizeMeanInCh[0]->SetTitle(
"Cluster size mean (npads) per track in chamber i");
1130 hClusterSizeMeanInCh[0]->SetMaximum(18);
1131 hClusterSizeMeanInCh[0]->SetMinimum(0);
1132 for (
Int_t ich=0; ich<10; ich++) {
1133 hClusterSizeMeanInCh[ich]->SetLineColor(ich+1+ich/9);
1134 hClusterSizeMeanInCh[ich]->SetLineWidth(2);
1135 if (ich == 0) hClusterSizeMeanInCh[ich]->Draw(
"e");
1136 else hClusterSizeMeanInCh[ich]->Draw(
"esame");
1137 lClusterSizePerCh->AddEntry(hClusterSizeMeanInCh[ich],Form(
"ch%d",ich+1),
"PL");
1139 lClusterSizePerCh->Draw(
"same");
1141 cClusterSizePerCh->cd(2);
1142 hClusterSizeSigmaInCh[0]->SetStats(kFALSE);
1143 hClusterSizeSigmaInCh[0]->GetXaxis()->SetRange(1,ibin-1);
1144 hClusterSizeSigmaInCh[0]->GetXaxis()->SetNdivisions(1,kFALSE);
1146 hClusterSizeSigmaInCh[0]->SetLabelSize(0.04);
1147 hClusterSizeSigmaInCh[0]->SetTitle(
"Cluster size sigma (npads) per track in chamber i");
1148 hClusterSizeSigmaInCh[0]->SetMaximum(7);
1149 hClusterSizeSigmaInCh[0]->SetMinimum(0);
1150 for (
Int_t ich=0; ich<10; ich++) {
1151 hClusterSizeSigmaInCh[ich]->SetLineColor(ich+1+ich/9);
1152 hClusterSizeSigmaInCh[ich]->SetLineWidth(2);
1153 if (ich == 0) hClusterSizeSigmaInCh[ich]->Draw(
"e");
1154 else hClusterSizeSigmaInCh[ich]->Draw(
"esame");
1156 lClusterSizePerCh->Draw(
"same");
1158 cClusterSizePerCh->Print(OutFileNamePDF.Data());
1160 cClusterSizePerCh->Write();
1163 cout<<
"=================================================="<<endl;
1164 cout<<
"Display average X and Y position of clusters per chamber"<<endl;
1165 cout<<
"=================================================="<<endl;
1166 TLegend *lClusterHitMapPerCh =
new TLegend(0.92,0.45,0.99,0.99);
1167 TCanvas* cClusterHitMapPerCh =
new TCanvas(
"cClusterHitMapPerCh",
"cClusterHitMapPerCh",1200,900);
1168 cClusterHitMapPerCh->Divide(1,2);
1169 cClusterHitMapPerCh->GetPad(1)->SetRightMargin(0.1);
1170 cClusterHitMapPerCh->GetPad(2)->SetRightMargin(0.1);
1172 cClusterHitMapPerCh->cd(1);
1173 hClusterHitMapXInCh[0]->SetStats(kFALSE);
1174 hClusterHitMapXInCh[0]->GetXaxis()->SetRange(1,ibin-1);
1175 hClusterHitMapXInCh[0]->GetXaxis()->SetNdivisions(1,kFALSE);
1177 hClusterHitMapXInCh[0]->SetLabelSize(0.04);
1178 hClusterHitMapXInCh[0]->SetTitle(
"<X> of clusters - associated to a track - in chamber i");
1179 hClusterHitMapXInCh[0]->SetMaximum(30);
1180 hClusterHitMapXInCh[0]->SetMinimum(-30);
1181 for (
Int_t ich=0; ich<10; ich++) {
1182 hClusterHitMapXInCh[ich]->SetLineColor(ich+1+ich/9);
1183 hClusterHitMapXInCh[ich]->SetLineWidth(2);
1184 if (ich == 0) hClusterHitMapXInCh[ich]->Draw(
"e");
1185 else hClusterHitMapXInCh[ich]->Draw(
"esame");
1187 lClusterHitMapPerCh->AddEntry(hClusterHitMapXInCh[ich],Form(
"ch%d",ich+1),
"PL");
1189 lClusterHitMapPerCh->Draw(
"same");
1191 cClusterHitMapPerCh->cd(2);
1192 hClusterHitMapYInCh[0]->SetStats(kFALSE);
1193 hClusterHitMapYInCh[0]->GetXaxis()->SetRange(1,ibin-1);
1194 hClusterHitMapYInCh[0]->GetXaxis()->SetNdivisions(1,kFALSE);
1196 hClusterHitMapYInCh[0]->SetLabelSize(0.04);
1197 hClusterHitMapYInCh[0]->SetTitle(
"<Y> of clusters - associated to a track - in chamber i");
1198 hClusterHitMapYInCh[0]->SetMaximum(30);
1199 hClusterHitMapYInCh[0]->SetMinimum(-30);
1200 for (
Int_t ich=0; ich<10; ich++) {
1201 hClusterHitMapYInCh[ich]->SetLineColor(ich+1+ich/9);
1202 hClusterHitMapYInCh[ich]->SetLineWidth(2);
1203 if (ich == 0) hClusterHitMapYInCh[ich]->Draw(
"e");
1204 else hClusterHitMapYInCh[ich]->Draw(
"esame");
1206 lClusterHitMapPerCh->Draw(
"same");
1208 cClusterHitMapPerCh->Print(OutFileNamePDF.Data());
1210 cClusterHitMapPerCh->Write();
1213 cout<<
"=================================================="<<endl;
1214 cout<<
" Display tracks ChiSquare "<<endl;
1215 cout<<
"=================================================="<<endl;
1216 TCanvas* cChi2 =
new TCanvas(
"cChi2",
"cChi2",1200,900);
1219 hChi2_Mean->SetStats(kFALSE);
1220 hChi2_Mean->GetXaxis()->SetRange(1,ibin-1);
1221 hChi2_Mean->GetXaxis()->SetNdivisions(1,kFALSE);
1223 hChi2_Mean->SetLabelSize(0.04);
1224 hChi2_Mean->SetLineWidth(2);
1225 hChi2_Mean->Draw(
"e");
1228 hChi2_Sigma->SetStats(kFALSE);
1229 hChi2_Sigma->GetXaxis()->SetRange(1,ibin-1);
1230 hChi2_Sigma->GetXaxis()->SetNdivisions(1,kFALSE);
1232 hChi2_Sigma->SetLabelSize(0.04);
1233 hChi2_Sigma->SetLineWidth(2);
1234 hChi2_Sigma->Draw(
"e");
1236 cChi2->Print(OutFileNamePDF.Data());
1240 cout<<
"=================================================="<<endl;
1241 cout<<
" Display track Lpt/Hpt "<<endl;
1242 cout<<
"=================================================="<<endl;
1244 if ( hTriggerCutVsRun[0] && hTriggerCutVsRun[1] ) {
1245 TCanvas* cLptHpt =
new TCanvas(
"cLptHpt",
"cLptHpt",1200,900);
1246 cLptHpt->Divide(1,2);
1247 TLegend* legLptHpt =
new TLegend(0.72,0.7,0.9,0.85);
1248 legLptHpt->SetBorderSize(1);
1249 for (
Int_t ihisto=0; ihisto<2; ++ihisto) {
1250 cLptHpt->cd(ihisto+1);
1251 TH1* currHistos[2] = {hTriggerCutVsRun[ihisto], hTriggerCutWidthVsRun[ihisto]};
1252 for (
Int_t jhisto=0; jhisto<2; jhisto++ ) {
1253 currHistos[jhisto]->GetXaxis()->SetRange(1,ibin-1);
1254 currHistos[jhisto]->GetYaxis()->SetRangeUser(0.,5.);
1255 currHistos[jhisto]->LabelsOption(
"a");
1256 currHistos[jhisto]->SetStats(kFALSE);
1257 currHistos[jhisto]->GetXaxis()->SetLabelSize(0.04);
1258 currHistos[jhisto]->SetLineWidth(2);
1260 hTriggerCutWidthVsRun[ihisto]->SetLineColor(2);
1261 hTriggerCutWidthVsRun[ihisto]->SetMarkerColor(2);
1262 hTriggerCutWidthVsRun[ihisto]->SetFillColor(2);
1263 hTriggerCutWidthVsRun[ihisto]->SetFillStyle(3001);
1264 hTriggerCutWidthVsRun[ihisto]->Draw(
"e2");
1265 hTriggerCutVsRun[ihisto]->Draw(
"esame");
1266 if ( ihisto == 0 ) {
1267 legLptHpt->AddEntry(hTriggerCutWidthVsRun[ihisto],
"Fit width",
"f");
1268 legLptHpt->AddEntry(hTriggerCutVsRun[ihisto],
"pt cut from fit (stat error)",
"lp");
1269 legLptHpt->Draw(
"same");
1272 cLptHpt->Print(OutFileNamePDF.Data());
1278 cout<<
"=================================================="<<endl;
1279 cout<<
" Display muon trigger "<<endl;
1280 cout<<
"=================================================="<<endl;
1282 TCanvas* cMuonTriggerUnlikeLike =
new TCanvas(
"cMuonTriggerUnlikeLike",
"cMuonTriggerUnlikeLike",1200,900);
1283 TCanvas* cMuonTriggerHpt =
new TCanvas(
"cMuonTriggerHpt",
"cMuonTriggerHpt",1200,900);
1284 cMuonTriggerHpt->Divide(1,2);
1286 Int_t const ntrig = 3;
1287 Int_t const nhist = 3;
1288 TH1F *hRelMuonTrigger[ntrig], *hTot;
1291 Int_t conf[ntrig][nhist]={{0,1,3},{0,2,4},{1,2,5}};
1292 TString sconf[ntrig][nhist]={{
"hTriggerUnlikeOnly",
"hTriggerLikeOnly",
"hTriggerUnlikeAndLike"},{
"hTriggerUnlikeOnly",
"hTriggerHptOnly",
"hTriggerUnlikeAndHpt"},{
"hTriggerLikeOnly",
"hTriggerHptOnly",
"hTriggerLikeAndHpt"}};
1295 for (
Int_t i=0; i < ntrig; i++ ) {
1296 for (
Int_t j=0; j < nhist; j++ ) {
1297 sname = sconf[i][j]; sname +=(i+1);
1298 hMuonTrigger[conf[i][j]]->GetXaxis()->SetRange(1,ibin-1);
1299 hRelMuonTrigger[j] = (TH1F*)hMuonTrigger[conf[i][j]]->Clone(sname);
1300 hRelMuonTrigger[j]->SetLineColor(j+1);
1301 hRelMuonTrigger[j]->SetStats(kFALSE);
1302 hRelMuonTrigger[j]->GetXaxis()->SetNdivisions(1,kFALSE);
1303 hRelMuonTrigger[j]->LabelsOption(
"a");
1304 hRelMuonTrigger[j]->SetLabelSize(0.02);
1306 hRelMuonTrigger[j]->SetLineWidth(2);
1307 hRelMuonTrigger[j]->SetTitle(
"");
1312 hTot = (TH1F*) hRelMuonTrigger[0]->Clone(sname);
1313 hTot->Add(hRelMuonTrigger[1]);
1314 hTot->Add(hRelMuonTrigger[2],-1);
1315 hRelMuonTrigger[0]->Add(hRelMuonTrigger[2],-1);
1316 hRelMuonTrigger[1]->Add(hRelMuonTrigger[2],-1);
1318 for(
Int_t j=0; j < nhist; j++) hRelMuonTrigger[j]->Divide(hTot);
1320 if(i==0) cMuonTriggerUnlikeLike->cd();
1321 else cMuonTriggerHpt->cd(i);
1323 if (i==0) hRelMuonTrigger[i]->SetTitle(
"Relative muon triggers content");
1324 TLegend *leg =
new TLegend(0.72,0.7,0.9,0.85);
1325 leg->SetBorderSize(1);
1327 for(
Int_t j=0; j<nhist; j++){
1329 hRelMuonTrigger[j]->SetMaximum(1);
1330 hRelMuonTrigger[j]->SetMinimum(0);
1331 hRelMuonTrigger[j]->Draw(
"e");
1333 else hRelMuonTrigger[j]->Draw(
"esame");
1334 sname = sconf[i][j];
1335 leg->AddEntry(hRelMuonTrigger[j],sname,
"l");
1339 cMuonTriggerUnlikeLike->Print(OutFileNamePDF.Data());
1341 cMuonTriggerUnlikeLike->Write();
1342 cMuonTriggerHpt->Print(OutFileNamePDF.Data());
1343 cMuonTriggerHpt->Write();
1346 c1->Print(OutFileNamePDF_close.Data());
1349 rootFileOut->Close();
1354 delete triggersShortName;
1363 canvas->SetTopMargin(0.05);
1364 canvas->SetRightMargin(0.01);
1365 canvas->SetGridy(1);
1366 canvas->SetLogy(logy);
1373 if(!eventCounters)
return kFALSE;
1375 Double_t sum = eventCounters->GetSum(
"v0mult:low,int,high");
1377 if(sum<=0) result = kFALSE;
1379 cout<<
" Collision type is set to ";
1380 if( result == kFALSE) cout<<
"p-p"<<endl;
1381 else cout<<
"heavy-ion"<<endl;
1388 if ( !eventCounters )
return 0;
1390 TString cName = Form(
"c%s",canvasName.Data());
1391 TCanvas *cAll =
new TCanvas(canvasName.Data(),canvasName.Data());
1392 cAll->SetLeftMargin(0.18);
1393 cAll->SetRightMargin(0.18);
1398 for (
Int_t ibin=1; ibin <= hAll->GetYaxis()->GetNbins(); ++ibin ) {
1399 TString currLabel = hAll->GetYaxis()->GetBinLabel(ibin);
1400 TObjArray* labelArray = currLabel.Tokenize(
"-");
1401 labelArray->SetOwner();
1403 TString newLabel = labelArray->At(0)->GetName();
1404 if ( labelArray->GetEntries() >= 2 ) newLabel = Form(
"%s-%s", newLabel.Data(), labelArray->At(1)->GetName());
1405 hAll->GetYaxis()->SetBinLabel(ibin, newLabel.Data());
1415 if(!array)
return 0x0;
1418 cName += canvasName;
1419 TCanvas *cTriggerContent =
new TCanvas(canvasName,cName,1200,900);
1421 cTriggerContent->cd();
1423 TLegend* legcTC =
new TLegend(0.2,0.15,0.50,0.40);
1424 legcTC->SetHeader(
"Physics Selection");
1425 legcTC->AddEntry(
".",
"applied :",
"");
1427 for(
Int_t iTrig = 0; iTrig < array->GetEntriesFast(); iTrig++){
1429 if( iTrig == (array->GetEntriesFast()-1) )
continue;
1430 TH1* hNoPS =
static_cast<TH1*
>(trigNoPS.At(iTrig));
1431 TH1* hWithPS =
static_cast<TH1*
>(trigWithPS.At(iTrig));
1432 if (!hNoPS ||!hWithPS)
continue;
1433 hNoPS->SetLineStyle(2);
1435 hNoPS->SetMinimum(1e-3);
1437 hWithPS->Draw(
"same");
1440 hNoPS->Draw(
"same");
1441 hWithPS->Draw(
"same");
1443 legcTC->AddEntry(hWithPS,(( (TObjString*) array->At(iTrig) )->GetString()).
Data(),
"l");
1445 legcTC->AddEntry(
".",
"not applied :",
"");
1447 for(
Int_t iTrig = 0; iTrig < array->GetEntriesFast(); iTrig++){
1448 if( iTrig == (array->GetEntriesFast()-1) )
continue;
1449 TH1* hNoPS =
static_cast<TH1*
>(trigNoPS.At(iTrig));
1450 if(hNoPS) legcTC->AddEntry(hNoPS,(( (TObjString*) array->At(iTrig) )->GetString()).
Data(),
"l");
1453 legcTC->Draw(
"same");
1455 return cTriggerContent;
1460 if(!triggersB)
return 0x0;
1463 cName += canvasName;
1464 TCanvas *cRelativeTriggerContent =
new TCanvas(canvasName,cName,1200,900);
1466 cRelativeTriggerContent->cd();
1468 TObjArray relTrigNoPS(triggersB->GetEntriesFast());
1469 TLegend* legcRTC =
new TLegend(0.2,0.15,0.50,0.40);
1472 Int_t indAllTrig = triggersB->GetEntriesFast()-1;
1473 TH1* hAllTrig =
static_cast<TH1*
> (trigNoPS.At(indAllTrig));
1474 if(!hAllTrig)
return 0;
1476 for(
Int_t iTrig = 0; iTrig < triggersB->GetEntriesFast()-1; iTrig++){
1478 hName += ( (TObjString*) triggersB->At(iTrig) )->GetString();
1479 TH1* histo =
static_cast<TH1*
> (trigNoPS.At(iTrig));
1480 if(!histo)
continue;
1481 TH1* hRatio = (
TH1*) histo->Clone(hName);
1482 hRatio->Divide(hAllTrig);
1483 hRatio->SetLineStyle(1);
1485 hRatio->SetMaximum(1.5);
1486 hRatio->SetMinimum(0.001);
1487 hRatio->SetLabelSize(0.04);
1488 hRatio->GetYaxis()->SetTitle(
"Relative trigger content");
1492 hRatio->Draw(
"ESAME");
1494 relTrigNoPS.AddAt(hRatio,iTrig);
1497 legcRTC->SetHeader(
"Physics Selection not applied");
1498 for(
Int_t iTrig = 0; iTrig < triggersB->GetEntriesFast()-1; iTrig++){
1499 TH1* hRatio =
static_cast<TH1*
>(relTrigNoPS.At(iTrig));
1500 if (!hRatio)
continue;
1501 legcRTC->AddEntry(hRatio,(( (TObjString*) triggersB->At(iTrig) )->GetString()).
Data(),
"l");
1503 legcRTC->Draw(
"same");
1505 return cRelativeTriggerContent;
1510 if(!triggersB)
return 0x0;
1513 cName += canvasName;
1514 TCanvas *c1 =
new TCanvas(canvasName,cName,1200,900);
1518 TObjArray trigRatio(triggersB->GetEntriesFast());
1519 TLegend* legcRTC =
new TLegend(0.2,0.15,0.50,0.40);
1520 TString header =
"Physics Selection Cut on selected triggers:";
1521 if (canvasName.Contains(
"T0Flag")) header +=
" and T0 pile-up event selection";
1522 if (canvasName.Contains(
"T0SPDFlag")) header +=
" and T0, SPD pile-up event selection";
1523 legcRTC->SetHeader(header.Data());
1526 for(
Int_t iTrig = 0; iTrig < triggersB->GetEntriesFast()-1; iTrig++){
1529 hName += ( (TObjString*) triggersB->At(iTrig) )->GetString();
1530 TH1 * hWithPS = (
TH1*) (static_cast<TH1*> (trigWithPS.At(iTrig)));
1531 TH1 * hNoPS = (
TH1*) (static_cast<TH1*> (trigNoPS.At(iTrig)));
1532 if (!hNoPS || !hWithPS)
continue;
1533 TH1 *hRatio = (
TH1*) hWithPS->Clone(hName);
1534 hRatio->Divide(hNoPS);
1535 hName =
"ratioNoPS";
1536 hName += ( (TObjString*) triggersB->At(iTrig) )->GetString();
1539 hRatio->SetMaximum(1.5);
1540 hRatio->SetMinimum(0.05);
1541 hRatio->SetLabelSize(0.02);
1542 hRatio->GetYaxis()->SetTitle(
"Accepted / All from Phys. Sel.");
1543 hRatio->SetTitle(
"Physics Selection Cut");
1547 hRatio->Draw(
"ESAME");
1549 trigRatio.AddAt(hRatio,iTrig);
1552 for(
Int_t iTrig = 0; iTrig < triggersB->GetEntriesFast()-1; iTrig++){
1553 TH1 * histo =
static_cast<TH1*
> (trigRatio.At(iTrig));
1554 if (!histo)
continue;
1555 legcRTC->AddEntry(histo,(( (TObjString*) triggersB->At(iTrig) )->GetString()).
Data(),
"l");
1557 legcRTC->Draw(
"same");
1564 if(!triggersB || !legendHeader)
return 0x0;
1567 cName += canvasName;
1568 TCanvas *c1 =
new TCanvas(canvasName,cName,1200,900);
1574 TLegend* legcRTC =
new TLegend(0.2,0.15,0.50,0.40);
1575 legcRTC->SetHeader(
"V0 amplitude bins:");
1576 Int_t colorTab[3] = {kBlack,kRed,kBlue};
1577 TArrayI colorInd(centBinMaxi);
1578 for (
Int_t i = 0; i < centBinMaxi; i++ ) {
1579 if(i<3) colorInd.AddAt(colorTab[i],i);
1580 else colorInd.AddAt(colorTab[2]+i-2,i);
1585 Float_t yMin = 0.05, yMax = 2;
1587 for(
Int_t iCentBin = 0; iCentBin < centBinMaxi; iCentBin++){
1590 TH1 *hWithPS =
static_cast<TH1*
> (trigWithPS.At(index));
1591 TH1 *hNoPS =
static_cast<TH1*
> (trigNoPS.At(index));
1592 if (!hNoPS || !hWithPS)
continue;
1595 hName += ( (TObjString*) triggersB->At(trigNr) )->GetString();
1596 TH1 *hRatio = (
TH1*) hWithPS->Clone(hName);
1597 hRatio->Divide(hNoPS);
1598 hRatio->SetLineColor(colorInd.At(iCentBin));
1599 if ( iCentBin == 0 ) {
1600 hRatio->SetMaximum(yMax);
1601 hRatio->SetMinimum(yMin);
1602 hRatio->SetLabelSize(0.02);
1603 hRatio->GetYaxis()->SetTitle(
"Accepted / All from Phys. Sel.");
1604 TString sTitle =
"for ", sTitle2 = (( (TObjString*) triggersB->At(trigNr) )->GetString()).
Data();
1605 if ( !sTitle2.IsNull() ) sTitle += sTitle2;
1607 hRatio->SetTitle(Form(
"Phys. Sel. %s - Multiplicity from V0 amplitude",sTitle.Data()));
1611 hRatio->Draw(
"ESAME");
1613 trigWithPSRatio.AddAt(hRatio,iCentBin);
1616 for (
Int_t centBin = 0; centBin < centBinMaxi; centBin++ ){
1617 TH1 *hRatio =
static_cast<TH1*
> (trigWithPSRatio.At(centBin));
1618 if ( !hRatio )
continue;
1619 legcRTC->AddEntry(hRatio,(legendHeader[centBin]).
Data(),
"l");
1621 legcRTC->Draw(
"same");
1629 if(!triggersB || !legendHeader)
return 0x0;
1632 cName += canvasName;
1633 TCanvas *c1 =
new TCanvas(canvasName,cName,1200,900);
1637 Int_t const centBinMaxi = 2;
1638 TObjArray trigRatio(centBinMaxi), trigRatioNoPS(centBinMaxi);
1639 TLegend* legcRTC =
new TLegend(0.2,0.15,0.50,0.40);
1640 legcRTC->SetHeader(
"Physics Selection");
1642 Int_t colorTab[2] = {kRed,kBlue};
1643 TArrayI colorInd(centBinMaxi);
1644 for (
Int_t i = 0; i < centBinMaxi; i++ ) {
1645 if(i<2) colorInd.AddAt(colorTab[i],i);
1646 else colorInd.AddAt(colorTab[1]+i-1,i);
1651 Float_t yMin = 0., yMax = 0.3;
1654 Int_t centBinMin = 2;
1655 TH1 *hWithPSAll =
static_cast<TH1*
> (trigWithPS.At(1*triggersB->GetEntriesFast()+trigNr));
1656 TH1 *hNoPSAll =
static_cast<TH1*
> (trigNoPS.At(1*triggersB->GetEntriesFast()+trigNr));
1657 if (!hNoPSAll || !hWithPSAll)
return 0;
1659 for (
Int_t centBin = centBinMin; centBin < centBinMaxi+centBinMin; centBin++){
1664 TH1 *hWithPS =
static_cast<TH1*
> (trigWithPS.At(index));
1665 TH1 *hNoPS =
static_cast<TH1*
> (trigNoPS.At(index));
1666 if (!hNoPS || !hWithPS)
continue;
1669 hName += ( (TObjString*) triggersB->At(trigNr) )->GetString();
1670 TH1 *hRatio = (
TH1*) hWithPS->Clone(hName);
1671 hRatio->Divide(hWithPSAll);
1673 hRatio->SetLineColor(colorInd.At(centBin-centBinMin));
1674 hName =
"ratioNoPS";
1675 hName += ( (TObjString*) triggersB->At(trigNr) )->GetString();
1676 TH1 *hRatioNoPS = (
TH1*) (hNoPS->Clone(hName));
1677 hRatioNoPS->Divide(hNoPSAll);
1678 hRatioNoPS->Scale(0.8);
1679 hRatioNoPS->SetLineStyle(2);
1680 hRatioNoPS->SetLineColor(colorInd.At(centBin-centBinMin));
1682 if ( centBin == centBinMin ){
1683 hRatio->SetMaximum(yMax);
1684 hRatio->SetMinimum(yMin);
1685 hRatio->SetLabelSize(0.02);
1686 hRatio->GetYaxis()->SetTitle(
"Centrality percentile check");
1687 TString sTitle =
"for ", sTitle2 = (( (TObjString*) triggersB->At(trigNr) )->GetString()).
Data();
1688 if ( !sTitle2.IsNull() ) sTitle += sTitle2;
1690 hRatio->SetTitle(Form(
"Centrality percentile check %s - Multiplicity from V0 amplitude",sTitle.Data()));
1692 hRatioNoPS->Draw(
"EPSAME");
1695 hRatio->Draw(
"ESAME");
1696 hRatioNoPS->Draw(
"EPSAME");
1698 trigRatio.AddAt(hRatio,centBin-centBinMin);
1699 trigRatioNoPS.AddAt(hRatioNoPS,centBin-centBinMin);
1702 legcRTC->AddEntry(
".",
"applied :",
"");
1703 for(
Int_t centBin = centBinMin; centBin < centBinMaxi+centBinMin; centBin++){
1704 TH1 *hRatio =
static_cast<TH1*
> (trigRatio.At(centBin-centBinMin));
1705 if (!hRatio)
continue;
1706 legcRTC->AddEntry(hRatio,(legendHeader[centBin]).
Data(),
"l");
1708 legcRTC->AddEntry(
".",
"not applied :",
"");
1709 for(
Int_t centBin = centBinMin; centBin < centBinMaxi+centBinMin; centBin++){
1710 TH1 *hRatioNoPS =
static_cast<TH1*
> (trigRatioNoPS.At(centBin-centBinMin));
1711 if (!hRatioNoPS)
continue;
1712 legcRTC->AddEntry(hRatioNoPS,(legendHeader[centBin]).
Data(),
"l");
1714 legcRTC->Draw(
"same");
1722 if(!triggersB || trigNr<0 || centNr<0 )
return 0x0;
1726 TH1 *hTrackerPerB, *hTriggerPerB, *hMatchedPerB, *hAllTracksPerB, *hTrigSel, *histo;
1729 hNameBase =( (TObjString*) triggersB->At(trigNr) )->GetString();
1731 hTrigSel =
static_cast<TH1*
> (trigSel.At(index));
1732 if (!hTrigSel)
return 0;
1734 hName = Form(
"hTrackerPer%s",hNameBase.Data());
1735 histo =
static_cast<TH1*
> (trackTracker.At(index));
1736 if (!histo)
return 0;
1737 hTrackerPerB = (
TH1*) histo->Clone(hName);
1738 if ( hTrackerPerB->GetEntries() ) hTrackerPerB->Divide(hTrigSel);
1739 hTrackerPerB->SetLineColor(kRed);
1741 hName = Form(
"hTriggerPer%s",hNameBase.Data());
1742 histo =
static_cast<TH1*
> (trackTrigger.At(index));
1743 if (!histo)
return 0;
1744 hTriggerPerB = (
TH1*) histo->Clone(hName);
1745 if ( hTriggerPerB->GetEntries() > 0 ) hTriggerPerB->Divide(hTrigSel);
1746 hTriggerPerB->SetLineColor(kBlue);
1748 hName = Form(
"hMatchedPer%s",hNameBase.Data());
1749 histo =
static_cast<TH1*
> (trackMatched.At(index));
1750 if (!histo)
return 0;
1751 hMatchedPerB = (
TH1*) histo->Clone(hName);
1752 if ( hMatchedPerB->GetEntries() > 0 ) hMatchedPerB->Divide(hTrigSel);
1753 hMatchedPerB->SetLineColor(kViolet);
1755 hName = Form(
"hAllTracksPer%s",hNameBase.Data());
1756 histo =
static_cast<TH1*
> (trackAll.At(index));
1757 if (!histo)
return 0;
1758 hAllTracksPerB = (
TH1*) histo->Clone(hName);
1759 if ( hAllTracksPerB->GetEntries() > 0 ) hAllTracksPerB->Divide(hTrigSel);
1761 hAllTracksPerB->SetLineWidth(3);
1762 hAllTracksPerB->SetLineColor(kBlack);
1763 hAllTracksPerB->SetTitle(Form(
"Number of Tracks /%s %s",hNameBase.Data(),legendHeader.Data()));
1764 hAllTracksPerB->SetMinimum(0.0001);
1765 if ( hAllTracksPerB->GetEntries() == 0 ) hAllTracksPerB->SetMaximum(0.1);
1766 hAllTracksPerB->SetLabelSize(0.02);
1769 cName += canvasName;
1770 hNameBase = ( (TObjString*) triggersB->At(trigNr) )->GetString();
1772 TCanvas *cRatioTrackTypesB =
new TCanvas(canvasName,cName,1200,900);
1774 cRatioTrackTypesB->cd();
1776 TLegend* legcTTCINT1B;
1778 hAllTracksPerB->Draw(
"E");
1779 hTrackerPerB->Draw(
"Esame");
1780 hMatchedPerB->Draw(
"Esame");
1781 hTriggerPerB->Draw(
"Esame");
1783 legcTTCINT1B =
new TLegend(0.70,0.5,0.90,0.70);
1784 legcTTCINT1B->AddEntry(hAllTracksPerB,
"All tracks",
"l");
1785 legcTTCINT1B->AddEntry(hTrackerPerB,
"Tracking (only) tracks",
"l");
1786 legcTTCINT1B->AddEntry(hMatchedPerB,
"Matched tracks",
"l");
1787 legcTTCINT1B->AddEntry(hTriggerPerB,
"Trigger (only) tracks",
"l");
1788 legcTTCINT1B->Draw(
"same");
1790 return cRatioTrackTypesB;
1796 if( !triggersB || centNr < 0 || trigNr < 0 )
return 0x0;
1799 TString hNameBase = ( (TObjString*) triggersB->At(trigNr) )->GetString();
1801 TString cName = Form(
"c%s%s",canvasName.Data(),hNameBase.Data());
1802 TCanvas *cTrackMultB =
new TCanvas(canvasName,cName,1200,900);
1804 cTrackMultB->Divide(1,2);
1807 TH1* hSumTriggerOverB, *hSumTrackerOverB, *hTrigSel, *hTracker, *hTrigger, *hMatched;
1810 hTrigSel =
static_cast<TH1*
> (trigSel.At(index));
1811 if (!hTrigSel)
return 0;
1812 hTracker =
static_cast<TH1*
> (trackTracker.At(index));
1813 if (!hTracker)
return 0;
1814 hTrigger =
static_cast<TH1*
> (trackTrigger.At(index));
1815 if (!hTrigger)
return 0;
1816 hMatched =
static_cast<TH1*
> (trackMatched.At(index));
1817 if (!hMatched)
return 0;
1819 hName = Form(
"hSumTriggerOver%s",hNameBase.Data());
1820 hSumTriggerOverB = (
TH1*) hTrigger->Clone(hName);
1821 hSumTriggerOverB->Add(hMatched);
1822 hSumTriggerOverB->Divide(hTrigSel);
1823 hName = Form(
"Sum of trigger tracks (matched + trigger-only) / # events in %s %s",hNameBase.Data(),legendHeader.Data());
1824 hSumTriggerOverB->SetTitle(hName);
1825 hSumTriggerOverB->SetLabelSize(0.04);
1826 hSumTriggerOverB->SetLineColor(kBlue);
1828 hName = Form(
"hSumTrackerOver%s",hNameBase.Data());
1829 hSumTrackerOverB = (
TH1*) hTracker->Clone(hName);
1830 hSumTrackerOverB->Add(hMatched);
1831 hSumTrackerOverB->Divide(hTrigSel);
1832 hName = Form(
"Sum of tracker tracks (matched + tracker-only) / # events in %s %s",hNameBase.Data(),legendHeader.Data());
1833 hSumTrackerOverB->SetTitle(hName);
1835 hSumTrackerOverB->SetLabelSize(0.04);
1836 hSumTrackerOverB->SetLineColor(kBlue);
1838 hSumTriggerOverB->Draw(
"e");
1840 hSumTrackerOverB->Draw(
"e");
1848 if(!triggersB || trigNr < 0 || centNr < 0 )
return 0x0;
1851 TString hNameBase =( (TObjString*) triggersB->At(trigNr) )->GetString();
1853 TString cName = Form(
"c%s%s",canvasName.Data(),hNameBase.Data());
1854 TCanvas *cRatioTrackB =
new TCanvas(canvasName,cName,1200,900);
1857 TH1* hTrackerOverTriggerB, *hMatchedOverTriggerB, *hMatchedOverTrackerB, *hTrigSel, *hTracker, *hTrigger, *hMatched;
1858 hTrigSel =
static_cast<TH1*
> (trigSel.At(index));
1859 if (!hTrigSel)
return 0;
1860 hTracker =
static_cast<TH1*
> (trackTracker.At(index));
1861 if (!hTracker)
return 0;
1862 hTrigger =
static_cast<TH1*
> (trackTrigger.At(index));
1863 if (!hTrigger)
return 0;
1864 hMatched =
static_cast<TH1*
> (trackMatched.At(index));
1865 if (!hMatched)
return 0;
1867 TString hName = Form(
"hTrackerOverTrigger%s",hNameBase.Data());
1868 hTrackerOverTriggerB = (
TH1*) hTracker->Clone(hName);
1869 hTrackerOverTriggerB->Divide(hTrigger);
1870 hName = Form(
"# tracker tracks / # trigger tracks in %s %s",hNameBase.Data(),legendHeader.Data());
1871 hTrackerOverTriggerB->SetTitle(hName);
1873 hTrackerOverTriggerB->SetLabelSize(0.02);
1874 hTrackerOverTriggerB->SetLineColor(kBlue);
1876 hName = Form(
"hMatchedOverTrigger%s",hNameBase.Data());
1877 hMatchedOverTriggerB = (
TH1*) hMatched->Clone(hName);
1878 hMatchedOverTriggerB->Divide(hTrigger);
1879 hName = Form(
"# matched tracks / # trigger tracks in %s %s",hNameBase.Data(),legendHeader.Data());
1880 hMatchedOverTriggerB->SetTitle(hName);
1882 hMatchedOverTriggerB->SetLabelSize(0.02);
1883 hMatchedOverTriggerB->SetLineColor(kBlue);
1885 hName = Form(
"hMatchedOverTracker%s",hNameBase.Data());
1886 hMatchedOverTrackerB = (
TH1*) hMatched->Clone(hName);
1887 hMatchedOverTrackerB->Divide(hTracker);
1888 hName = Form(
"# matched tracks / # tracker tracks in %s %s",hNameBase.Data(),legendHeader.Data());
1889 hMatchedOverTrackerB->SetTitle(hName);
1891 hMatchedOverTrackerB->SetLabelSize(0.02);
1892 hMatchedOverTrackerB->SetLineColor(kBlue);
1894 cRatioTrackB->Divide(1,3);
1895 cRatioTrackB->cd(1);
1896 hTrackerOverTriggerB->Draw(
"e");
1897 cRatioTrackB->cd(2);
1898 hMatchedOverTriggerB->Draw(
"e");
1899 cRatioTrackB->cd(3);
1900 hMatchedOverTrackerB->Draw(
"e");
1902 return cRatioTrackB;
1907 if(!triggersB || trigNr < 0 || centNr < 0 )
return 0x0;
1910 TString hName, hNameBase = (( (TObjString*) triggersB->At(trigNr) )->GetString());
1912 TString cName = Form(
"c%s%s",canvasName.Data(),hNameBase.Data());
1913 TCanvas *cAsymMatched =
new TCanvas(canvasName.Data(),cName,1200,900);
1917 TH1* hPosMatched, *hNegMatched, *hAllMatched;
1919 hPosMatched =
static_cast<TH1*
> (trackPosMatched.At(index));
1920 if (!hPosMatched)
return 0;
1921 hNegMatched =
static_cast<TH1*
> (trackNegMatched.At(index));
1922 if (!hNegMatched)
return 0;
1923 hAllMatched =
static_cast<TH1*
> (trackAllMatched.At(index));
1924 if (!hAllMatched)
return 0;
1926 hName = Form(
"hAsyMatchedFor%s",hNameBase.Data());
1927 TH1 *hAsymMatched = (
TH1*) hPosMatched->Clone(hName);
1928 hAsymMatched->Add(hNegMatched,-1);
1929 hAsymMatched->Divide(hAllMatched);
1930 hAsymMatched->SetLineColor(kRed);
1931 hAsymMatched->SetMinimum(-0.3);
1932 hAsymMatched->SetMaximum(0.3);
1933 hAsymMatched->SetLabelSize(0.02);
1934 hName = Form(
"Matched tracks charge asymmetry for %s with acc. cuts %s",hNameBase.Data(),legendHeader.Data());
1935 hAsymMatched->SetTitle(hName);
1936 hAsymMatched->GetYaxis()->SetTitle(
"Charged tracks asymmetry");
1937 hAsymMatched->Draw(
"EH");
1939 return cAsymMatched;
1945 if ( !triggersB || trigNr < 0 || centNr < 0 )
return 0x0;
1948 TString hName, hNameBase = (( (TObjString*) triggersB->At(trigNr) )->GetString());
1950 TString cName = Form(
"c%s%s",canvasName.Data(),hNameBase.Data());
1951 TCanvas *cHighPtMuons =
new TCanvas(canvasName.Data(),cName,1200,900);
1956 TH1* hRelMatchedLowPt, *hRelMatchedHighPt, *hTrigSel, *hMatchedLowPt, *hAllMatchedHighPt;
1957 hTrigSel =
static_cast<TH1*
> (trigSel.At(index));
1958 if (!hTrigSel)
return 0;
1959 hMatchedLowPt =
static_cast<TH1*
> (trackMatchedLowPt.At(index));
1960 if (!hMatchedLowPt)
return 0;
1961 hAllMatchedHighPt =
static_cast<TH1*
> (trackAllMatchedHighPt.At(index));
1962 if (!hAllMatchedHighPt)
return 0;
1964 hName = Form(
"hMatchedLowPtPer%s ",hNameBase.Data());
1965 hRelMatchedLowPt = (
TH1*) hMatchedLowPt->Clone(hName);
1966 hRelMatchedLowPt->Divide(hTrigSel);
1967 hRelMatchedLowPt->SetLineColor(kBlue);
1968 hRelMatchedLowPt->SetTitle(
"");
1969 hName = Form(
"Ratio per %s ",hNameBase.Data());
1970 hRelMatchedLowPt->GetYaxis()->SetTitle(hName);
1971 hRelMatchedLowPt->SetMinimum(0.0001);
1972 hRelMatchedLowPt->SetLabelSize(0.02);
1974 hName = Form(
"hMatchedHighPtPer%s ",hNameBase.Data());
1975 hRelMatchedHighPt = (
TH1*) hAllMatchedHighPt->Clone(hName);
1976 hRelMatchedHighPt->Divide(hTrigSel);
1977 hRelMatchedHighPt->SetLineColor(kRed);
1979 hName = Form(
"Number of matched track per %s (include Vtx and R_{Abs} cuts) %s",hNameBase.Data(),legendHeader.Data());
1980 hRelMatchedLowPt->SetTitle(hName);
1981 hRelMatchedLowPt->Draw(
"E");
1982 hRelMatchedHighPt->Draw(
"Esame");
1984 legcHPM =
new TLegend(0.60,0.45,0.98,0.65);
1986 legcHPM->AddEntry(
".",
"Physics selection applied :",
"");
1987 legcHPM->AddEntry(hRelMatchedLowPt,
" p_{T} > 1 GeV/c ",
"l");
1988 legcHPM->AddEntry(hRelMatchedHighPt,
" p_{T} > 2 GeV/c ",
"l");
1989 legcHPM->Draw(
"same");
1991 return cHighPtMuons;
1996 if(!triggersB || trigNr < 0 || centNr < 0 )
return 0x0;
1999 TString hName, hNameBase = (( (TObjString*) triggersB->At(trigNr) )->GetString());
2001 TString cName = Form(
"c%s%s",canvasName.Data(),hNameBase.Data());
2002 TCanvas *cBeamGasMatched =
new TCanvas(canvasName.Data(),cName,1200,900);
2004 cBeamGasMatched->cd();
2006 TH1* hBeamGasMatched, *hBeamGasMatchedHighPt, *hAllMatched, *hMatchedHighPt;
2008 hBeamGasMatched =
static_cast<TH1*
> (trackBeamGasMatched.At(index));
2009 if (!hBeamGasMatched)
return 0;
2010 hBeamGasMatchedHighPt =
static_cast<TH1*
> (trackBeamGasMatchedHighPt.At(index));
2011 if (!hBeamGasMatchedHighPt)
return 0;
2012 hAllMatched =
static_cast<TH1*
> (trackAllMatched.At(index));
2013 if (!hAllMatched)
return 0;
2014 hMatchedHighPt =
static_cast<TH1*
> (trackMatchedHighPt.At(index));
2015 if (!hMatchedHighPt)
return 0;
2017 hName = Form(
"hBeamGasMatchedPer%s ",hNameBase.Data());
2018 TH1 *hRelBeamGasMatched = (
TH1*) hBeamGasMatched->Clone(hName);
2019 hRelBeamGasMatched->Divide(hAllMatched);
2020 hRelBeamGasMatched->SetLineColor(kBlack);
2021 hRelBeamGasMatched->SetMinimum(0.0);
2022 hRelBeamGasMatched->SetMaximum(1.1);
2023 hRelBeamGasMatched->SetLabelSize(0.02);
2025 hName = Form(
"hBeamGasMatchedHightPtPer%s ",hNameBase.Data());
2026 TH1 *hRelBeamGasMatchedHighPt = (
TH1*) hBeamGasMatchedHighPt->Clone(hName);
2027 hRelBeamGasMatchedHighPt->Divide(hMatchedHighPt);
2028 hRelBeamGasMatchedHighPt->SetLineColor(kRed);
2030 hName = Form(
"Identified beam-gas tracks (pxDCA cuts) in matched tracks for %s",hNameBase.Data());
2031 if(!legendHeader.IsNull()) hName += Form(
" %s",legendHeader.Data());
2032 hRelBeamGasMatched->SetTitle(hName);
2033 hRelBeamGasMatched->GetYaxis()->SetTitle(
"Relative beam-gas tracks");
2034 hRelBeamGasMatched->Draw(
"EH");
2035 hRelBeamGasMatchedHighPt->Draw(
"EHsame");
2037 TLegend *leg =
new TLegend(0.60,0.45,0.98,0.65);
2038 leg->AddEntry(
".",
"Physics selection applied :",
"");
2039 leg->AddEntry(hRelBeamGasMatched,
" All p_{T}",
"l");
2040 leg->AddEntry(hRelBeamGasMatchedHighPt,
" p_{T} > 2 GeV/c ",
"l");
2043 return cBeamGasMatched;
2048 return ( centNr * triggers->GetEntriesFast() + trigNr );
2055 if( !counter )
return h1;
2059 if ( !hSelection.Contains(
"trigger: /") && !hSelection.Contains(
"trigger:/") ) h1 = (
TH1*) counter->Draw(hVariable,hSelection);
2061 if ( !h1 ) h1 =
new TH1D(hName,
"",10,0,10);
2063 if ( h1->GetSumw2N() == 0 ) h1->Sumw2();
2064 h1->LabelsOption(
"a");
2065 if(hName.Sizeof()>1) h1->SetName(hName);
2066 if(xName.Sizeof()>1) h1->GetXaxis()->SetTitle(xName);
2067 if(yName.Sizeof()>1) h1->GetYaxis()->SetTitle(yName);
2068 if(color>0) h1->SetLineColor(color);
2069 h1->SetLineWidth(2);
2080 if( !counter )
return h1;
2083 if(hName.Sizeof()==1) setName = kFALSE;
2085 h1 = (
TH2*) counter->Draw(hVariable,hVariable2,hSelection);
2086 if ( !h1 ) h1 =
new TH2D(hName,
"",10,0,10,10,0,10);
2088 if ( h1->GetSumw2N() == 0 ) h1->Sumw2();
2089 h1->LabelsOption(
"a");
2090 if(setName) h1->SetName(hName);
2104 if( !triggersB || !triggersShortName)
return kFALSE;
2105 Int_t const nColumn = 2;
2106 TObjArray* triggers[nColumn] = {triggersShortName, triggersB};
2108 TString trigSuffix[nColumn] = {
"",
"B"};
2112 for (
Int_t ibeam=0; ibeam<nColumn; ++ibeam ) {
2113 fullTriggerList[ibeam] =
new TObjArray();
2114 fullTriggerList[ibeam]->SetOwner();
2118 if ( triggerList ) {
2120 ifstream inFile(triggerList);
2121 if (!inFile.is_open()) {
2122 Error(
"PlotMuonQA",
"unable to open file %s", triggerList);
2126 while ( !inFile.eof() ) {
2128 for (
Int_t ibeam=0; ibeam<nColumn; ++ibeam ) {
2129 currTrigName.ReadToken( inFile );
2130 if ( ! isGoodB )
continue;
2131 if ( currTrigName.IsNull() || ! currTrigName.IsAscii() ) {
2132 if ( ibeam==0 || ibeam == 1 ) {
2136 currTrigName =
"notrigger";
2138 fullTriggerList[ibeam]->AddLast(
new TObjString(currTrigName));
2144 TObjArray *triggersInContainer = listFromContainer.Tokenize(
",");
2146 for (
Int_t iTrig = 0; iTrig < triggersInContainer->GetEntriesFast(); iTrig++ ) {
2147 currTrigName = triggersInContainer->At(iTrig)->GetName();
2149 TString rejectPatterns =
"-E- -A- -C- WU UP SPI PHI EMC ZED TRUE SHM TPC BEAM 1A 1C";
2150 TObjArray* rejArray = rejectPatterns.Tokenize(
" ");
2151 for (
Int_t ipat=0; ipat<rejArray->GetEntriesFast(); ipat++ ) {
2152 if ( currTrigName.Contains(rejArray->At(ipat)->GetName()) ) {
2158 if (!keep)
continue;
2160 for (
Int_t ibeam = 0; ibeam < nColumn; ibeam++) {
2161 fullTriggerList[ibeam]->AddLast(
new TObjString(currTrigName) );
2166 printf(
"INFO: no trigger selected over %d triggers: all triggers kept!!\n",
2167 triggersInContainer->GetEntriesFast());
2168 for (
Int_t iTrig = 0; iTrig < triggersInContainer->GetEntriesFast(); iTrig++ ) {
2169 currTrigName = triggersInContainer->At(iTrig)->GetName();
2170 for (
Int_t ibeam = 0; ibeam < nColumn; ibeam++) {
2171 fullTriggerList[ibeam]->AddLast(
new TObjString(currTrigName) );
2175 if ( triggersInContainer )
delete triggersInContainer;
2181 TObjArray *triggersFromContainer = listFromContainer.Tokenize(
",");
2182 TObjString* trigName = 0x0;
2184 TString selectAllTriggers[nColumn];
2185 for (
Int_t ibeam=0; ibeam<nColumn; ++ibeam ) selectAllTriggers[ibeam]=
"";
2187 for (
Int_t itrig=0; itrig<fullTriggerList[0]->GetEntries(); ++itrig ) {
2188 Bool_t isBadTrig = kFALSE;
2189 for (
Int_t ibeam=0; ibeam<nColumn; ++ibeam ) {
2190 currTrigName = fullTriggerList[ibeam]->At(itrig)->GetName();
2192 if ( ibeam == 0 && currTrigName.Contains(
"NOSHOW") ) {
2197 if ( ibeam > 0 && triggersFromContainer ) {
2198 TIter nextTrigger( triggersFromContainer );
2200 while ( ( trigName = static_cast<TObjString*>(nextTrigger()) ) ) {
2201 if ( currTrigName.Contains(trigName->GetString()) ){
2205 if ( isBadTrig == kTRUE ){
2207 if ( triggers[0]->GetLast() != (triggers[0]->LowerBound()-1) ) triggers[0]->RemoveAt(triggers[0]->GetLast());
2213 triggers[ibeam]->AddLast(
new TObjString(currTrigName));
2214 if ( isBadTrig )
continue;
2215 if ( ! selectAllTriggers[ibeam].IsNull() ) selectAllTriggers[ibeam] +=
",";
2216 selectAllTriggers[ibeam] += currTrigName;
2219 if(triggersFromContainer)
delete triggersFromContainer;
2220 if(trigName)
delete trigName;
2224 cout<<
" Nr of triggers read "<<triggers[0]->GetEntriesFast()<<endl;
2225 for (
Int_t ibeam=0; ibeam<nColumn; ++ibeam ) {
2226 triggers[ibeam]->AddLast(
new TObjString(selectAllTriggers[ibeam]));
2227 printf(
" %s triggers:\n", trigSuffix[ibeam].
Data());
2228 triggers[ibeam]->Print();
2229 delete fullTriggerList[ibeam];
2238 TObjArray* array = filePath.Tokenize(
"/");
2242 for (
Int_t ientry=0; ientry<array->GetEntries(); ientry++ ) {
2243 auxString = array->At(ientry)->GetName();
2244 if ( auxString.IsDigit() && auxString.Length()>=6 && auxString.Length()<=9 ) {
2245 runNum = auxString.Atoi();
2252 array = auxString.Tokenize(
"_");
2254 auxString = array->Last()->GetName();
2255 auxString.ReplaceAll(
".root",
"");
2256 if ( auxString.IsDigit() ) runNum = auxString.Atoi();
2270 ifstream inFile(runList);
2271 if (!inFile.is_open()) {
2272 Error(
"PlotMuonQA",
"unable to open file %s", runList);
2277 while (!inFile.eof()) {
2278 currLine.ReadLine(inFile);
2279 if ( currLine.IsNull() )
continue;
2282 Warning(
"PlotMuonQA",
"invalid run number: %s", currLine.Data());
2285 if(runs) runs->AddLast(
new TObjString(Form(
"%d", currRun)));
2286 selectRuns += Form(
"%i,",currRun);
2288 selectRuns.Remove(TString::kTrailing,
',');
2293 cout<<
"runList is not set"<<endl;
2294 if(runs) runs->AddLast(
new TObjString(
"*"));
2297 printf(
"selected runs from runlist %s: %s\n",runList, selectRuns.Data());
2304 ifstream inFile(inputList);
2305 if ( ! inFile.is_open()) {
2306 printf(
"Error: cannot find inputList %s\n", inputList);
2310 TFileMerger fileMerger;
2311 Int_t mergeType = ( TFileMerger::kRegular | TFileMerger::kAll | TFileMerger::kOnlyListed );
2312 fileMerger.AddObjectNames(
"MUON_QA");
2313 while ( ! inFile.eof() ) {
2314 currLine.ReadLine(inFile);
2315 if ( ! currLine.EndsWith(
".root") )
continue;
2316 fileMerger.AddFile(currLine.Data());
2319 if ( fileMerger.GetMergeList()->GetEntries() == 0 )
return kFALSE;
2320 fileMerger.OutputFile(outFilename,kTRUE,1);
2321 fileMerger.PartialMerge(mergeType);
Int_t color[]
print message on plot with ok/not ok
TString kCentLegendName[kCentBinMax]
TCanvas * ProcessCanvasPhysSelCutCentrality(TObjArray *triggersB, TObjArray trigNoPS, TObjArray trigBWithPS, Int_t trigNr, TString canvasName, TString *legendHeader)
TString format
file names tag, basically the trigger and calorimeter combination
void PlotMuonQA(const char *baseDir, const char *runList=0x0, const char *triggerList=0x0, Bool_t selectPhysics=kFALSE, const char *LHCPeriod="LHC11c", const char *QAFileName="QAresults.root")
TH1 * ProcessHisto(AliCounterCollection *counter, TString variable, TString selection, TString hName="", TString xName="", TString yName="", Int_t color=1)
TCanvas * ProcessCanvasTrackMultB(TObjArray *triggersB, TObjArray trigSel, TObjArray trackTracker, TObjArray trackTrigger, TObjArray trackMatched, Int_t trigNr, Int_t centNr, TString canvasName, TString legendHeader="")
void SetCanvas(TCanvas *canvas, Int_t logy=1)
TCanvas * ProcessCanvasCentralityPercentile(TObjArray *triggersB, TObjArray trigNoPS, TObjArray trigWithPS, Int_t trigNr, TString canvasName, TString *legendHeader)
Bool_t MergeOutputs(const char *, const char *)
Bool_t IsHeavyIonCollision(AliCounterCollection *eventCounters)
TCanvas * ProcessCanvasRatioTrackB(TObjArray *triggersB, TObjArray trigSel, TObjArray trackTracker, TObjArray trackTrigger, TObjArray trackMatched, Int_t trigNr, Int_t centNr, TString canvasName, TString legendHeader="")
TCanvas * ProcessCanvasBeamGasMatched(TObjArray *triggersB, TObjArray trackBeamGasMatched, TObjArray trackBeamGasMatchedHighPt, TObjArray trackAllMatched, TObjArray trackMatchedHighPt, Int_t trigNr, Int_t centNr, TString canvasName, TString legendHeader="")
Bool_t GetTriggerLists(const char *triggerList, TString listFromContainer, TObjArray *triggersB=0, TObjArray *triggersShortName=0)
TString GetRunList(const char *runList, TObjArray *runs)
TH2 * ProcessHisto2D(AliCounterCollection *counter, TString hVariable, TString hVariable2, TString hSelection, TString hName)
TCanvas * ProcessCanvasTracksoverTrigger(TObjArray *triggersB, TObjArray trigSel, TObjArray trackTracker, TObjArray trackTrigger, TObjArray trackMatched, TObjArray trackAll, Int_t trigNr, Int_t centNr, TString canvasName, TString legendHeader="")
TCanvas * ProcessCanvasAllTrigger(AliCounterCollection *counter, TString canvasName)
Int_t GetIndex(TObjArray *triggersB, Int_t trigNr, Int_t centNr)
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
TCanvas * ProcessCanvasTriggerContent(TObjArray *trigName, TObjArray trigNoPS, TObjArray trigWithPS, TString canvasName)
TCanvas * ProcessCanvasHighPtMuons(TObjArray *triggersB, TObjArray trigSel, TObjArray trackMatchedLowPt, TObjArray trackAllMatchedHightPt, Int_t trigNr, Int_t centNr, TString canvasName, TString legendHeader="")
TCanvas * ProcessCanvasPhysSelCut(TObjArray *triggersB, TObjArray trigNoPS, TObjArray trigWithPS, TString canvasName)
TCanvas * ProcessCanvasRelativeTriggerContent(TObjArray *array, TObjArray trigNoPS, TString canvasName)
TCanvas * ProcessCanvasAsymMatched(TObjArray *triggersB, TObjArray trackPosMatched, TObjArray trackNegMatched, TObjArray trackhAllMatched, Int_t trigNr, Int_t centNr, TString canvasName, TString legendHeader="")
Int_t GetRunNumber(TString)
TString kCentLegendNameShort[kCentBinMax]
TString kCentBinName[kCentBinMax]