AliPhysics  eb0e5d9 (eb0e5d9)
runAnalysisBC.C
Go to the documentation of this file.
1 
20 
21 // --- ROOT system ---
22 #include <TStopwatch.h>
23 #include <TROOT.h>
24 
25 // --- ANALYSIS system ---
26 #include "BadChannelAna.h" //include when compile
27 
30 void runAnalysisBC(Int_t nversion = -1, TString period = "LHC15n", TString train = "Train_603", TString trigger= "INT7", Int_t runNum= 245683, TString externalFile= "",TString listName="runList.txt",TString workDir=".")
31 {
32  gROOT->ProcessLine("gErrorIgnoreLevel = kWarning;"); //..to supress a lot of standard output
33  gROOT->SetBatch(1); //..Prevent ROOT from stealing focus when plotting
34 
35  std::vector<Int_t> badcellsManual;
36 
37  //..15o block 1
38  //badcellsManual.insert(badcellsManual.end(),{14655,14622,14640,14728,14726,14593,14599,14600,14645,14646,14759,14776});
39 
40  //..If nversion=-1
41  //..this is detected as a run-by-run analysis
42  if(nversion == -1)nversion=runNum; //..If you do the analysis run by run - this might be helpful
43 
44  TStopwatch* watch = new TStopwatch();
45  watch->Start();
46 
48  Analysis=new BadChannelAna(period,train,trigger,runNum,nversion,workDir,listName);
49 
50  //. . . . . . . . . . . . . . . . . . . . . . . .
51  //. . Settings
52  //. . . . . . . . . . . . . . . . . . . . . . . .
53  Analysis->SetExternalMergedFile(externalFile);
54  //Analysis->AddManualMasking(badcellsManual);
55  //Analysis->AddMaskSM(16); //..switch off entire SMs
56  //Analysis->AddMaskSM(9); //..switch off entire SMs
57  //Analysis->AddMaskSM(11); //..switch off entire SMs
58  //Analysis->SetLowerBound(1); //..If the Emin of the energy range (Emin-Emax) is higher than X GeV then dont apply a lower cut on the distribution
59  Analysis->SetLowerBound(0.4); //..If the Emin of the energy range (Emin-Emax) is higher than X GeV then dont apply a lower cut on the distribution
60  //Analysis->SetStartEndCell(0,12288); //..only EMCal
61  //Analysis->SetStartEndCell(12288,17664); //..only DCal
62  //Analysis->SetQAChecks(1); //..1= Perform QA checks - takes a long time! Saves all good cells for cross check to pdf
63  //Analysis->SetPrintOutput(1); //..1= prints more information about excluded cells
64  //Analysis->SetTrackCellRecord(1); //..1= prints non-zero flag elements thoughout the routine
65  //Analysis->SetExternalBadMap("Version286350_mSM11/LHC18d_INT7_Histograms_V286350.root");
66 
67  //. . . . . . . . . . . . . . . . . . . . . . . .
68  //. . Add different period analyses
69  //. . . . . . . . . . . . . . . . . . . . . . . .
70  Double_t sigmaNHits=5.5;
71  Double_t sigmaE_hit=4.5;
72  //..a little stricter
73  sigmaNHits=5.0;
74  sigmaE_hit=4.5;
75  //..the range of sigmas should be selected such
76  //..that one does not cut into the natural fluctuation over the modules
77  Analysis->AddPeriodAnalysis(5, sigmaNHits,0.1,0.3); // hits in cell in range Emin Emax
78  Analysis->AddPeriodAnalysis(1, sigmaE_hit,0.1,0.3); // energy/hit in range Emin Emax
79  Analysis->AddPeriodAnalysis(5, sigmaNHits,0.2,0.5); // hits in cell range Emin Emax
80  Analysis->AddPeriodAnalysis(1, sigmaE_hit,0.2,0.5); // energy/hit in range Emin Emax
81  Analysis->AddPeriodAnalysis(5, sigmaNHits,0.5,1.0); // hits in cell range Emin Emax
82  Analysis->AddPeriodAnalysis(1, sigmaE_hit,0.5,1.0); // energy/hit in range Emin Emax
83  Analysis->AddPeriodAnalysis(5, sigmaNHits,1.0,4.0); // hits in cell range Emin Emax
84  Analysis->AddPeriodAnalysis(1, sigmaE_hit,1.0,4.0); // mean energy in range Emin Emax
85  Analysis->AddPeriodAnalysis(5, sigmaNHits,1.0,10.0); // hits in cell in range Emin Emax
86  Analysis->AddPeriodAnalysis(1, sigmaE_hit,1.0,10.0); // energy/hit in range Emin Emax
87  Analysis->AddPeriodAnalysis(5, sigmaNHits-1,0.11,0.29); // hits in cell in range Emin Emax
88 
89 
90  //..special test for extra high energy fluctuations
91  Analysis->AddPeriodAnalysis(1, 4.0,3.0,40.0); // energy/hit in cell in range Emin Emax
92 // Analysis->AddPeriodAnalysis(1, 80.0,3.0,40.0); // IN CASE something fails - energy/hit in cell in range Emin Emax
93 // Analysis->AddPeriodAnalysis(5, 4.0,3.0,40.0); // hits in cell range Emin Emax
94  //Analysis->AddPeriodAnalysis(1, 4.5,3.0,5.0); // mean energy in range Emin Emax - cliff
95  //Analysis->AddPeriodAnalysis(5, 5.5,3.0,5.0); // hits in cell range Emin Emax - cliff
96 
97  //..Add a cut on the time distribution
98 // Analysis->AddPeriodAnalysis(3, 6,-20,+20); // hits with time -20-20ns/all times
99  Analysis->AddPeriodAnalysis(3, 4,550,750); // hits with time 550-750ns/all times
100 // Analysis->AddPeriodAnalysis(3, 16,550,750); // IN CASE there are some problems with the fit hits with time 550-750ns/all times
101 
102  //*test time stuff*/ Analysis->AddPeriodAnalysis(3, 6,-20,+20);// energy/hit in range Emin Emax
103 
104  //. . . . . . . . . . . . . . . . . . . . . . . .
105  //. . Start the bad channel analysis
106  //. . . . . . . . . . . . . . . . . . . . . . . .
107  Bool_t mergeOnly=0;//.. =1 do only merge and filter
108  Analysis->Run(mergeOnly);
109 
110  watch->Stop();
111  cout<<"Finished BC analysis "<<watch->RealTime()/60<<" min"<<endl;
112  cout<<"Canvases will pop up now - please wait"<<endl;
113 
114  //if(watch) delete watch;
115  //if(Analysis) delete Analysis; //..Delete Causes problems
116 }
void Run(Bool_t mergeOnly=0)
double Double_t
Definition: External.C:58
void SetExternalMergedFile(TString inputName)
Definition: BadChannelAna.h:58
void AddPeriodAnalysis(Int_t criteria, Double_t nsigma, Double_t emin, Double_t emax)
int Int_t
Definition: External.C:63
Analyses cell properties and identifies bad cells.
Definition: BadChannelAna.h:48
void runAnalysisBC(Int_t nversion=-1, TString period="LHC15n", TString train="Train_603", TString trigger="INT7", Int_t runNum=245683, TString externalFile="", TString listName="runList.txt", TString workDir=".")
Definition: runAnalysisBC.C:30
bool Bool_t
Definition: External.C:53
void SetLowerBound(Double_t input)
Definition: BadChannelAna.h:64