#include <AliCDBManager.h>
#include <AliOADBContainer.h>
#include <AliTRDCalDet.h>
+#include "AliTRDonlineTrackMatching.h"
#include <AliLog.h>
#include <TTree.h>
AliTenderSupply(),
fESD(NULL),
fESDpid(NULL),
+ fTrdOnlineTrackMatcher(NULL),
fChamberGainOld(NULL),
fChamberGainNew(NULL),
fChamberVdriftOld(NULL),
fHasReferences(kFALSE),
fHasNewCalibration(kTRUE),
fDebugMode(kFALSE),
- fNameRunByRunCorrection(),\r
- fNormalizationFactorArray(NULL)\r
+ fRedoTrdMatching(kTRUE),
+ fNameRunByRunCorrection(),
+ fNormalizationFactorArray(NULL)
{
//
// default ctor
//
- memset(fBadChamberID, 0, sizeof(Int_t) * kNChambers);\r
+ memset(fBadChamberID, 0, sizeof(Int_t) * kNChambers);
memset(fSlicesForPID, 0, sizeof(UInt_t) * 2);
}
AliTenderSupply(name,tender),
fESD(NULL),
fESDpid(NULL),
+ fTrdOnlineTrackMatcher(NULL),
fChamberGainOld(NULL),
fChamberGainNew(NULL),
fChamberVdriftOld(NULL),
fHasReferences(kFALSE),
fHasNewCalibration(kTRUE),
fDebugMode(kFALSE),
- fNameRunByRunCorrection(),\r
- fNormalizationFactorArray(NULL)\r
+ fRedoTrdMatching(kTRUE),
+ fNameRunByRunCorrection(),
+ fNormalizationFactorArray(NULL)
{
//
// named ctor
//
// dtor
//
- if(fNormalizationFactorArray) delete fNormalizationFactorArray;\r
+ if(fNormalizationFactorArray) delete fNormalizationFactorArray;
+ delete fTrdOnlineTrackMatcher;
}
//_____________________________________________________
//fESDpid->SetTRDslicesForPID(fSlicesForPID[0], fSlicesForPID[1]);
if(fNameRunByRunCorrection.Length()) LoadRunByRunCorrection(fNameRunByRunCorrection.Data());
-
+ fTrdOnlineTrackMatcher=new AliTRDonlineTrackMatching();
// Set Normalisation Factors
if(mgr->GetMCtruthEventHandler()){
// Assume MC
if (!fESD) return;
if(fNormalizationFactorArray) fNormalizationFactor = GetNormalizationFactor(fESD->GetRunNumber());\r
Int_t ntracks=fESD->GetNumberOfTracks();
-
+
+
+
+ if (fRedoTrdMatching) {
+ if (!fTrdOnlineTrackMatcher->ProcessEvent(fESD)) {
+ AliError("TRD online track matching failed!");
+ }
+ }
+
+
+
//
// recalculate PID probabilities
//
//
TVectorD *corrfactor = dynamic_cast<TVectorD *>(fRunByRunCorrection->GetObject(fTender->GetRun()));
- if(!corrfactor){ \r
+ if(!corrfactor){
// No correction available - simply return\r
- AliDebug(2, "Couldn't derive gain correction factor from OADB");\r
- return;\r
- }\r
+ AliDebug(2, "Couldn't derive gain correction factor from OADB");
+ return;
+ }
else AliDebug(2, Form("Gain factor from OADB %f", (*corrfactor)[0]));
Double_t slice = 0;
for(Int_t ily = 0; ily < kNPlanes; ily++){
track->SetTRDslice(slice, ily, islice);
}
}
-}\r
-\r
-//_____________________________________________________\r
-void AliTRDTenderSupply::SetNormalizationFactor(Double_t norm, Int_t runMin, Int_t runMax) { \r
- //\r
- // Set the normalisation factor for a given run range\r
- //\r
- if(!fNormalizationFactorArray)\r
- fNormalizationFactorArray = new TObjArray;\r
- TVectorD *entry = new TVectorD(3);\r
- TVectorD &myentry = *entry;\r
- myentry(0) = runMin;\r
- myentry(1) = runMax;\r
- myentry(2) = norm;\r
- fNormalizationFactorArray->Add(entry);\r
-}\r
-\r
-//_____________________________________________________\r
-Double_t AliTRDTenderSupply::GetNormalizationFactor(Int_t runnumber){\r
- // \r
+}
+
+//_____________________________________________________
+void AliTRDTenderSupply::SetNormalizationFactor(Double_t norm, Int_t runMin, Int_t runMax) {
+ //
+ // Set the normalisation factor for a given run range
+ //
+ if(!fNormalizationFactorArray)
+ fNormalizationFactorArray = new TObjArray;
+ TVectorD *entry = new TVectorD(3);
+ TVectorD &myentry = *entry;
+ myentry(0) = runMin;
+ myentry(1) = runMax;
+ myentry(2) = norm;
+ fNormalizationFactorArray->Add(entry);
+}
+
+//_____________________________________________________
+Double_t AliTRDTenderSupply::GetNormalizationFactor(Int_t runnumber){
+ //
// Load the normalization factor\r
- //\r
- Double_t norm = 1.;\r
- if(fNormalizationFactorArray){\r
- TVectorD *entry;\r
- Int_t runMin, runMax;\r
- TIter entries(fNormalizationFactorArray);\r
- while((entry = dynamic_cast<TVectorD *>(entries()))){\r
- TVectorD &myentry = *entry;\r
- runMin = TMath::Nint(myentry(0));\r
- runMax = TMath::Nint(myentry(1));\r
- if(runnumber >= runMin && runnumber <= runMax) norm = myentry(2);\r
- }\r
- }\r
- AliDebug(1, Form("Gain normalization factor: %f\n", norm));\r
- return norm;\r
+ //
+ Double_t norm = 1.;
+ if(fNormalizationFactorArray){
+ TVectorD *entry;
+ Int_t runMin, runMax;
+ TIter entries(fNormalizationFactorArray);
+ while((entry = dynamic_cast<TVectorD *>(entries()))){
+ TVectorD &myentry = *entry;
+ runMin = TMath::Nint(myentry(0));
+ runMax = TMath::Nint(myentry(1));
+ if(runnumber >= runMin && runnumber <= runMax) norm = myentry(2);
+ }
+ }
+ AliDebug(1, Form("Gain normalization factor: %f\n", norm));
+ return norm;
}
//_____________________________________________________
class AliTRDCalDet;
class AliESDEvent;
class AliOADBContainer;
+class AliTRDonlineTrackMatching;
class AliTRDTenderSupply: public AliTenderSupply {
// void SetLoadReferencesFromFile() { fLoadReferences = kTRUE; fLoadReferencesFromCDB = kFALSE; }
void SetLoadDeadChambersFromCDB(){ fLoadDeadChambers = kTRUE;} ;
void SetPIDmethod(Int_t pidMethod) { fPIDmethod = pidMethod; }
- void SetNormalizationFactor(Double_t norm, Int_t runMin, Int_t runMax);\r
+ void SetNormalizationFactor(Double_t norm, Int_t runMin, Int_t runMax);
void SetNormalizationFactor(Double_t norm) { fNormalizationFactor = norm; }
void SetCalibLowpThreshold(Double_t pmin) { fPthreshold = pmin; };
void SetGeoFile(const char *filename) { fGeoFile = filename; }
void SetDebugMode() { fDebugMode = kTRUE; }
+ void SetRedoTRDMatching(Bool_t redo = kTRUE) {fRedoTrdMatching = redo;}
virtual void Init();
virtual void ProcessEvent();
void LoadDeadChambersFromCDB();
void LoadRunByRunCorrection(const char *filename);
Bool_t IsBadChamber(Int_t chamberID);
- Double_t GetNormalizationFactor(Int_t runnumber);\r
+ Double_t GetNormalizationFactor(Int_t runnumber);
AliESDEvent *fESD; //! the ESD Event
AliESDpid *fESDpid; //! ESD PID object
+ AliTRDonlineTrackMatching *fTrdOnlineTrackMatcher; //! TRD online track matcher
AliTRDCalDet *fChamberGainOld; // TRD Chamber Gain Factor used for producing the ESD
AliTRDCalDet *fChamberGainNew; // New TRD Chamber Gain Factor
Bool_t fHasReferences; // has references loaded
Bool_t fHasNewCalibration; // has new calibration
Bool_t fDebugMode; // Run in debug mode
+ Bool_t fRedoTrdMatching; // Redo Track Matching
TString fNameRunByRunCorrection; // filename with the run-by-run gain correction
TObjArray *fNormalizationFactorArray; // Array with normalisation Factors\r