AliPhysics  1811c8f (1811c8f)
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(7); //..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("Version1OADB/LHC16s_INT7_Histograms_V1.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(2, 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(2, 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(2, 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(2, 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(2, 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(2, 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(2, 4.0,3.0,40.0); // hits in cell range Emin Emax
91  //Analysis->AddPeriodAnalysis(1, 4.5,3.0,5.0); // mean energy in range Emin Emax - cliff
92  //Analysis->AddPeriodAnalysis(2, 5.5,3.0,5.0); // hits in cell range Emin Emax - cliff
93  //Analysis->AddPeriodAnalysis(1, 4.5,5,20); // energy/hit in range Emin Emax
94  //Analysis->AddPeriodAnalysis(2, 5.5,5,20); // hits in range Emin Emax
95 
96  //*test time stuff*/ Analysis->AddPeriodAnalysis(3, 6,-20,+20);// energy/hit in range Emin Emax
97 
98  //. . . . . . . . . . . . . . . . . . . . . . . .
99  //. . Start the bad channel analysis
100  //. . . . . . . . . . . . . . . . . . . . . . . .
101  Bool_t mergeOnly=0;//.. =1 do only merge and filter
102  Analysis->Run(mergeOnly);
103 
104  watch->Stop();
105  cout<<"Finished BC analysis "<<watch->RealTime()/60<<" min"<<endl;
106  cout<<"Canvases will pop up now - please wait"<<endl;
107 
108  //if(watch) delete watch;
109  //if(Analysis) delete Analysis; //..Delete Causes problems
110 }
void Run(Bool_t mergeOnly=0)
double Double_t
Definition: External.C:58
void SetTrackCellRecord(Bool_t inputBool)
Definition: BadChannelAna.h:62
void SetExternalMergedFile(TString inputName)
Definition: BadChannelAna.h:58
void AddPeriodAnalysis(Int_t criteria, Double_t nsigma, Double_t emin, Double_t emax)
void AddManualMasking(std::vector< Int_t > cellVector)
Definition: BadChannelAna.h:65
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