-
Notifications
You must be signed in to change notification settings - Fork 1
/
AliRPCAutoIntegrator.h
153 lines (128 loc) · 5.02 KB
/
AliRPCAutoIntegrator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
//
// AliRPCAutoIntegrator.h
//
// Created by Gabriele Gaetano Fronzé
// Copyright © 2016 Gabriele Gaetano Fronzé. All rights reserved.
#ifndef AliRPCAutoIntegrator_h
#define AliRPCAutoIntegrator_h
#include "TObject.h"
#include "TNamed.h"
#include "TString.h"
#include "TFile.h"
#include "AliRPCData.h"
#include "AliOCDBRun.h"
#include "AliCDBManager.h"
#include "AliGRPObject.h"
#include "AliCDBStorage.h"
#include "AliMpCDB.h"
#include "AliCDBEntry.h"
#include "AliMpDDLStore.h"
#include "AliMUONTriggerScalers.h"
#include "AliDCSValue.h"
#include "AliRPCValueDCS.h"
#include "AliRPCRunStatistics.h"
#include "AliRPCValueCurrent.h"
#include "AliRPCValueVoltage.h"
#include "AliRPCValueScaler.h"
#include "AliRPCOverflowStatistics.h"
#include "TGraph.h"
#include "TMultiGraph.h"
// #include "TClass.h"
#include <fstream>
#include <iostream>
#include <vector>
#include <stdio.h>
#include "TList.h"
#include "TObjArray.h"
#include "TClonesArray.h"
#include "TObjString.h"
#include "TH1F.h"
typedef struct {
Int_t Side;
Int_t Plane;
Int_t RPC;
} RPC;
class AliRPCAutoIntegrator : public TObject{
public:
AliRPCAutoIntegrator();
AliRPCAutoIntegrator(TString RunListFileName, TString AMANDAInputFileName, TString OutputFileName, Bool_t updateOCDB=kTRUE, Bool_t updateAMANDA=kTRUE);
AliRPCAutoIntegrator(const AliRPCAutoIntegrator &obj) : TObject(obj){};
~AliRPCAutoIntegrator();
void InitDataMembers();
void RunAutoIntegrator();
void GeneratePlotFromFile(TString filename = "plots.txt");
void VoltagePlotter(TGraph *Graph, TList* list, UInt_t RunNumber);
void VoltagePlotter(TGraph *Graph, TList* list, std::vector<UInt_t> RunNumberList);
void VoltagePlotter(TGraph *Graph, TList* list);
private:
std::vector<AliOCDBRun> fOCDBRunListToAdd;
TString fRunListFileName;
TString fAMANDAInputFileName;
TString fOutputFileName;
TFile *fOCDBDataContainer;
TFile *fAMANDADataContainer;
TFile *fGlobalDataContainer;
Bool_t fUpdateOCDB;
Bool_t fUpdateAMANDA;
Bool_t fExistsRPCDataObject;
public:
AliRPCData *fAliRPCDataObject;
private:
static const Int_t kNSides=2;
static const Int_t kNPlanes=4;
static const Int_t kNRPC=9;
static const Int_t kNLocalBoards=234;
static const ULong64_t kFullScale=65535;
static const Int_t kNCathodes=2;
static const TString *fSides;
static const Int_t *fPlanes;
static const TString *fCathodes;
//array per la conversione di iRPC={0,17} in iRPC={1,9}x{inside,outside}
static const Int_t *kRPCIndexes;
static const Int_t *kRPCSides;
static const Int_t *kLBToRPC;
Double_t fRPCAreas[kNRPC][kNPlanes];
Double_t fLBAreas[kNLocalBoards][kNPlanes];
Double_t fTinyArea[kNPlanes];
Double_t fLittleArea[kNPlanes];
Double_t fNormalArea[kNPlanes];
Double_t fBigArea[kNPlanes];
static const Int_t *fColors;//[kNRPC] = {kBlack,kRed,kGreen,kBlue,kYellow,kMagenta,kCyan,kGray,kOrange};
static const Int_t *fStyles;//[kNPlanes]={20,24,21,25};
Bool_t CheckPointer(TNamed *pointer){
Bool_t output=!pointer;
if(output) {
printf("\nproblem with %s\n",pointer->GetName());
}
return output;
}
public:
void OCDBRunListReader();
void OCDBDataToCParser();
void AMANDATextToCParser();
void FillAliRPCData();
void Aggregator();
void GeneratePlots();
void Subtractor();
void Integrator();
void IntegratorPerRun();
void AMANDASetDataMembers();
private:
inline Bool_t checkFileExistance(TString fileName) {
ifstream f(fileName.Data());
return f.good();
}
void CreateDistributionSomething(TH1 *Graph, Bool_t (AliRPCValueDCS::*funky)() const, TList *DataList, vector<AliOCDBRun*> RunNumberList, Int_t whichValue);
void CreateDistributionSomething(TH1 *Graph, TString label, TList *list, vector <AliOCDBRun*> RunNumberList);
void PlotSomethingVersusTime(TGraph *Graph, Bool_t (AliRPCValueDCS::*funky)() const, TList *list, std::vector<UInt_t> RunNumberList, Int_t whichValue=0);
void PlotSomethingVersusTime(TGraph *Graph, Bool_t (AliRPCValueDCS::*funky)()const, TList *list, UInt_t RunNumber, Int_t whichValue=0);
void PlotSomethingVersusTime(TGraph *Graph, Bool_t (AliRPCValueDCS::*funky)()const, TList *list, std::vector<AliOCDBRun*> RunNumberList, Int_t whichValue=0);
void PlotSomethingVersusTime(TGraph *Graph, Bool_t (AliRPCValueDCS::*funky)()const, TList *list, Int_t whichValue=0);
void PlotSomethingVersusRun(TGraph *Graph, Double_t (AliRPCData::*funky)(UInt_t, Bool_t)const, Bool_t normalizedToArea=kFALSE);
void PlotSomethingVersusRPC(TGraph *Graph, Double_t (AliRPCData::*funkyX)(Int_t, Int_t, Int_t, Bool_t)const, Double_t (AliRPCData::*funkyY)(Int_t, Int_t, Int_t, Bool_t)const);
void PlotSomethingVersusSomethingElse(TGraph *Graph, const TString x, const TString y, TList *list=nullptr);
static void PrintWhichRPC(Int_t iRPC, Int_t iSide, Int_t iPlane);
Bool_t IsRunInList(std::vector<UInt_t> vector, UInt_t number);
ClassDef(AliRPCAutoIntegrator,8);
};
#endif