17 #include <THashList.h>
19 #include <TLorentzVector.h>
24 #include "AliEMCALGeometry.h"
25 #include "AliInputEventHandler.h"
26 #include "AliVCaloTrigger.h"
27 #include "AliVEvent.h"
28 #include "AliVVertex.h"
38 fLocalInitialized(false),
40 fRequestTrigger(AliVEvent::kAny),
50 fLocalInitialized(false),
52 fRequestTrigger(AliVEvent::kAny),
55 DefineOutput(1, TList::Class());
65 const int kMaxCol = 48, kMaxRow = 104, kMaxFastOr = kMaxRow * kMaxCol;
68 fHistos->
CreateTH1(
"hFastOrFrequencyL0",
"FastOr frequency at Level0", kMaxFastOr, -0.5, kMaxFastOr - 0.5);
69 fHistos->
CreateTH1(
"hFastOrFrequencyL1",
"FastOr frequency at Level1", kMaxFastOr, -0.5, kMaxFastOr - 0.5);
70 fHistos->
CreateTH2(
"hFastOrAmplitude",
"FastOr amplitudes", kMaxFastOr, -0.5, kMaxFastOr - 0.5, 513, -0.5, 512.5);
71 fHistos->
CreateTH2(
"hFastOrTimeSum",
"FastOr time sum", kMaxFastOr, -0.5, kMaxFastOr - 0.5, 2049, -0.5, 2048.5);
72 fHistos->
CreateTH2(
"hFastOrTransverseTimeSum",
"FastOr transverse time sum", kMaxFastOr, -0.5, kMaxFastOr - 0.5, 2049, -0.5, 2048.5);
73 fHistos->
CreateTH2(
"hFastOrNL0Times",
"FastOr Number of L0 times", kMaxFastOr, -0.5, kMaxFastOr - 0.5, 16, -0.5, 15.5);
74 fHistos->
CreateTH2(
"hFastOrColRowFrequencyL0",
"FastOr Frequency (col-row) at Level1", kMaxCol, -0.5, kMaxCol - 0.5, kMaxRow, -0.5, kMaxRow - 0.5);
75 fHistos->
CreateTH2(
"hFastOrColRowFrequencyL1",
"FastOr Frequency (col-row) at Level0", kMaxCol, -0.5, kMaxCol - 0.5, kMaxRow, -0.5, kMaxRow - 0.5);
97 fOldRun = InputEvent()->GetRunNumber();
106 const AliVVertex *vtx = fInputEvent->GetPrimaryVertex();
112 AliVCaloTrigger *triggerdata = InputEvent()->GetCaloTrigger(
"EMCAL");
113 triggerdata->Reset();
114 Int_t nl0times, l1timesum, fastOrID, globCol, globRow;
116 while(triggerdata->Next()){
117 triggerdata->GetAmplitude(amp);
118 triggerdata->GetNL0Times(nl0times);
119 triggerdata->GetL1TimeSum(l1timesum);
120 triggerdata->GetPosition(globCol, globRow);
121 fGeom->GetTriggerMapping()->GetAbsFastORIndexFromPositionInEMCAL(globCol, globRow, fastOrID);
143 fGeom->GetTriggerMapping()->GetCellIndexFromFastORIndex(fastorAbsID, cellIDs);
144 std::vector<double> eta, phi;
145 for(
int i = 0l; i < 4; i++){
146 double etatmp, phitmp;
147 fGeom->EtaPhiFromIndex(cellIDs[i], etatmp, phitmp);
148 eta.push_back(etatmp);
149 phi.push_back(phitmp);
154 TVector3 fastorPos, vertexPos(vertex[0], vertex[1], vertex[2]);
155 fastorPos.SetPtEtaPhi(
fGeom->GetIPDistance(), TMath::Mean(eta.begin(), eta.end()), TMath::Mean(phi.begin(), phi.end()));
156 fastorPos -= vertexPos;
158 TLorentzVector evec(fastorPos, adc);
AliEmcalFastOrMonitorTask()
Int_t fOldRun
Old Run (for RunChanged())
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
ULong_t fRequestTrigger
Trigger selection bits.
THashList * GetListOfHistograms() const
Double_t GetTransverseTimeSum(Int_t fastorAbsID, Double_t adc, const Double_t *vtx) const
virtual void UserCreateOutputObjects()
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
AliEMCALGeometry * fGeom
! EMCAL Geometry object
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Bool_t fLocalInitialized
Switch whether task is initialized (for ExecOnce)
virtual ~AliEmcalFastOrMonitorTask()
std::vector< int > fMaskedFastors
List of masked fastors.
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
TString fTriggerPattern
Trigger string pattern used in addition to the trigger selection bits.
virtual void RunChanged()
Container class for histograms.
Int_t GetRunNumber(TString)
virtual void UserExec(Option_t *)
THistManager * fHistos
! Histogram handler
Simlple monitoring of EMCAL FastOr quantities.