#include <TClonesArray.h>
#include <TTree.h>
+#include <TMath.h>
#include "AliLoader.h"
#include "AliLog.h"
extern AliRun* gAlice;
+AliTOFGeometry* AliTOFTrigger::fgTofGeo = NULL; // TOF geometry needed to get the minimial arrival time for each channel
+
//-------------------------------------------------------------------------
ClassImp(AliTOFTrigger)
fNCrateOn(0),
fNMaxipadOn(0),
fNMaxipadOnAll(0),
- fTOFTrigMask(0)
+ fTOFTrigMask(0),
+ fStartTimeHit(0.0),
+ fTimeWidthTrigger(25.0)
+
{
//main ctor
for (Int_t i=0;i<kNCTTM;i++) fLTMarray[i] = kFALSE;
//----------------------------------------------------------------------
-AliTOFTrigger::AliTOFTrigger(Int_t HighMultTh, Int_t ppMBTh, Int_t MultiMuonTh, Int_t UPTh, Float_t deltaminpsi, Float_t deltamaxpsi, Float_t deltaminro, Float_t deltamaxro, Int_t stripWindow) :
+AliTOFTrigger::AliTOFTrigger(Int_t HighMultTh, Int_t ppMBTh, Int_t MultiMuonTh, Int_t UPTh, Float_t deltaminpsi, Float_t deltamaxpsi, Float_t deltaminro, Float_t deltamaxro, Int_t stripWindow,Float_t startTimeWindow,Float_t widthTimeWindow) :
AliTriggerDetector(),
fHighMultTh(HighMultTh),
fppMBTh(ppMBTh),
fNCrateOn(0),
fNMaxipadOn(0),
fNMaxipadOnAll(0),
- fTOFTrigMask(0)
+ fTOFTrigMask(0),
+ fStartTimeHit(startTimeWindow),
+ fTimeWidthTrigger(widthTimeWindow)
{
//ctor with thresholds for triggers
for (Int_t i=0;i<kNCTTM;i++) fLTMarray[i] = kFALSE;
// Do not create inputs again!!
if( fInputs.GetEntriesFast() > 0 ) return;
- LoadActiveMask();
+ //LoadActiveMask();
fInputs.AddLast(new AliTriggerInput("TOF_Cosmic_MultiMuon_L0","TOF",0));
fInputs.AddLast(new AliTriggerInput("0OIN","TOF",0)); // was "TOF_pp_MB_L0"
fInputs.AddLast(new AliTriggerInput("0OM2","TOF",0)); // was "TOF_PbPb_MB2_L0"
fInputs.AddLast(new AliTriggerInput("0OM3","TOF",0)); // was "TOF_PbPb_MB3_L0"
fInputs.AddLast(new AliTriggerInput("0OUP","TOF",0)); // was "TOF_UltraPer_Coll_L0"
+ fInputs.AddLast(new AliTriggerInput("0OMU","TOF",0)); // new trigger (150 < DeltaPhi < 180) and 2 <= N_pad <= 6
fInputs.AddLast(new AliTriggerInput("0OHM","TOF",0)); // was "TOF_High_Mult_L0"
fInputs.AddLast(new AliTriggerInput("TOF_Jet_L1","TOF",0));
fSel4=0;
CreateLTMMatrix();
+
Int_t nchonFront = 0;
Int_t nchonBack = 0;
Int_t nchonTot = 0;
//printf("trigger On with AntiDeSlot \n");
}
- }
-
+ if(nchonTot >= 2 && nchonTot <= 6){
+ if(DeSlots >= 15 && DeSlots <= 18){
+ SetInput("0OMU");
+ }
+ else if(AntiDeSlots >= 15 && AntiDeSlots <= 18){
+ SetInput("0OMU");
+ }
+ }
+ }
}
}
}
//creating LTMMatrix
//initialization
CreateLTMMatrixFromDigits();
+ CreateCTTMMatrix();
}
//-------------------------------------------------------------------------
// 3 -> padz
// 4 -> padx
+ if(! fgTofGeo) fgTofGeo = new AliTOFGeometry();
+
+
for (Int_t i=0;i<ndigits;i++){
AliTOFdigit * digit = (AliTOFdigit*)tofDigits->UncheckedAt(i);
detind[0] = digit->GetSector();
Int_t indexLTM[2] = {-1,-1};
GetLTMIndex(detind,indexLTM);
- fLTMmatrix[indexLTM[0]][indexLTM[1]] = kTRUE;
+ //Float_t timedigit = digit->GetTdc()*AliTOFGeometry::TdcBinWidth()*1E-3; // decalibrated time digit in ns
+ Float_t timedigit = digit->GetTdcND()*AliTOFGeometry::TdcBinWidth()*1E-3; // time digit in ns
+
+ Float_t pos[3];
+ fgTofGeo->GetPosPar(detind, pos);
+ Float_t length = 0.;
+ for (Int_t ic = 0; ic < 3; ic++) length += pos[ic] * pos[ic];
+ length = TMath::Sqrt(length);
+ timedigit -= length * 0.0333564095198152043; // subtract the minimal time in ns for the current channel
+
+ if(timedigit > fStartTimeHit - 0.5 && timedigit < fStartTimeHit + fTimeWidthTrigger - 0.5)
+ fLTMmatrix[indexLTM[0]][indexLTM[1]] = kTRUE;
+
// fLTMarray[indexLTM[0]%36] = kTRUE; //dimensione MAX array 36 = kNCTTM
- }
+ }
tofLoader->UnloadDigits();
// rl->UnloadgAlice();
- CreateCTTMMatrix();
}
//
// Create CTTM bit map
//
+
+ LoadActiveMask();
+
Int_t fromTriggertoDCS[72] = {0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29,32,33,36,37,40,41,44,45,48,49,52,53,56,57,60,61,64,65,68,69,3,
2,7,6,11,10,15,14,19,18,23,22,27,26,31,30,35,34,39,38,43,42,47,46,51,50,55,54,59,58,63,62,67,66,71,70};