AliPhysics  239578e (239578e)
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  std::vector<Int_t> badcellsManual;
34 
35  //..15o block 1
36  //badcellsManual.insert(badcellsManual.end(),{14655,14622,14640,14728,14726,14593,14599,14600,14645,14646,14759,14776});
37 
38  //..If nversion=-1
39  //..this is detected as a run-by-run analysis
40  if(nversion == -1)nversion=runNum; //..If you do the analysis run by run - this might be helpful
41 
42  TStopwatch* watch = new TStopwatch();
43  watch->Start();
44 
46  Analysis=new BadChannelAna(period,train,trigger,runNum,nversion,workDir,listName);
47 
48  //. . . . . . . . . . . . . . . . . . . . . . . .
49  //. . Settings
50  //. . . . . . . . . . . . . . . . . . . . . . . .
51  Analysis->SetExternalMergedFile(externalFile);
52  //Analysis->AddManualMasking(badcellsManual);
53  //Analysis->AddMaskSM(16); //..switch off entire SMs
54  //Analysis->AddMaskSM(9); //..switch off entire SMs
55  //Analysis->AddMaskSM(11); //..switch off entire SMs
56  //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
57  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
58  //Analysis->SetStartEndCell(0,12288); //..only EMCal
59  //Analysis->SetStartEndCell(12288,17664); //..only DCal
60  //Analysis->SetQAChecks(1); //..1= Perform QA checks - takes a long time! Saves all good cells for cross check to pdf
61  //Analysis->SetPrintOutput(1); //..1= prints more information about excluded cells
62  //Analysis->SetTrackCellRecord(1); //..1= prints non-zero flag elements thoughout the routine
63  //Analysis->SetExternalBadMap("Version286350_mSM11/LHC18d_INT7_Histograms_V286350.root");
64 
65  //. . . . . . . . . . . . . . . . . . . . . . . .
66  //. . Add different period analyses
67  //. . . . . . . . . . . . . . . . . . . . . . . .
68  Double_t sigmaNHits=5.5;
69  Double_t sigmaE_hit=4.5;
70  //..a little stricter
71  sigmaNHits=5.0;
72  sigmaE_hit=4.5;
73  //..the range of sigmas should be selected such
74  //..that one does not cut into the natural fluctuation over the modules
75  Analysis->AddPeriodAnalysis(5, sigmaNHits,0.1,0.3); // hits in cell in range Emin Emax
76  Analysis->AddPeriodAnalysis(1, sigmaE_hit,0.1,0.3); // energy/hit in range Emin Emax
77  Analysis->AddPeriodAnalysis(5, sigmaNHits,0.2,0.5); // hits in cell range Emin Emax
78  Analysis->AddPeriodAnalysis(1, sigmaE_hit,0.2,0.5); // energy/hit in range Emin Emax
79  Analysis->AddPeriodAnalysis(5, sigmaNHits,0.5,1.0); // hits in cell range Emin Emax
80  Analysis->AddPeriodAnalysis(1, sigmaE_hit,0.5,1.0); // energy/hit in range Emin Emax
81  Analysis->AddPeriodAnalysis(5, sigmaNHits,1.0,4.0); // hits in cell range Emin Emax
82  Analysis->AddPeriodAnalysis(1, sigmaE_hit,1.0,4.0); // mean energy in range Emin Emax
83  Analysis->AddPeriodAnalysis(5, sigmaNHits,1.0,10.0); // hits in cell in range Emin Emax
84  Analysis->AddPeriodAnalysis(1, sigmaE_hit,1.0,10.0); // energy/hit in range Emin Emax
85  Analysis->AddPeriodAnalysis(5, sigmaNHits,0.11,0.29); // hits in cell in range Emin Emax
86 
87 
88  //..special test for extra high energy fluctuations
89  Analysis->AddPeriodAnalysis(1, 4.0,3.0,40.0); // energy/hit in cell in range Emin Emax
90 // Analysis->AddPeriodAnalysis(1, 80.0,3.0,40.0); // IN CASE something fails - energy/hit in cell in range Emin Emax
91 // Analysis->AddPeriodAnalysis(5, 4.0,3.0,40.0); // hits in cell range Emin Emax
92  //Analysis->AddPeriodAnalysis(1, 4.5,3.0,5.0); // mean energy in range Emin Emax - cliff
93  //Analysis->AddPeriodAnalysis(5, 5.5,3.0,5.0); // hits in cell range Emin Emax - cliff
94 
95  //..Add a cut on the time distribution
96 // Analysis->AddPeriodAnalysis(3, 6,-20,+20); // hits with time -20-20ns/all times
97  Analysis->AddPeriodAnalysis(3, 4,550,750); // hits with time 550-750ns/all times
98 // Analysis->AddPeriodAnalysis(3, 16,550,750); // IN CASE there are some problems with the fit hits with time 550-750ns/all times
99 
100  //*test time stuff*/ Analysis->AddPeriodAnalysis(3, 6,-20,+20);// energy/hit in range Emin Emax
101 
102  //. . . . . . . . . . . . . . . . . . . . . . . .
103  //. . Start the bad channel analysis
104  //. . . . . . . . . . . . . . . . . . . . . . . .
105  Bool_t mergeOnly=0;//.. =1 do only merge and filter
106  Analysis->Run(mergeOnly);
107 
108  watch->Stop();
109  cout<<"Finished BC analysis "<<watch->RealTime()/60<<" min"<<endl;
110  cout<<"Canvases will pop up now - please wait"<<endl;
111 
112  //if(watch) delete watch;
113  //if(Analysis) delete Analysis; //..Delete Causes problems
114 }
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