#include "AliV0vertexer.h"
#include "AliVertexer.h"
#include "AliVertexerTracks.h"
+#include "AliTriggerRunScalers.h"
+#include "AliCTPTimeParams.h"
+#include "AliESDHLTDecision.h"
ClassImp(AliReconstruction)
fRunMuonTracking(kFALSE),
fRunV0Finder(kTRUE),
fRunCascadeFinder(kTRUE),
- fStopOnError(kFALSE),
+ fStopOnError(kTRUE),
fWriteAlignmentData(kFALSE),
fWriteESDfriend(kFALSE),
fFillTriggerESD(kTRUE),
fRunInfo(NULL),
fEventInfo(),
fRunScalers(NULL),
+ fCTPTimeParams(NULL),
fRunLoader(NULL),
fRawReader(NULL),
fRunInfo(NULL),
fEventInfo(),
fRunScalers(NULL),
+ fCTPTimeParams(NULL),
fRunLoader(NULL),
fRawReader(NULL),
delete fRunScalers; fRunScalers = NULL;
if (rec.fRunScalers) fRunScalers = new AliTriggerRunScalers(*rec.fRunScalers);
-
+ delete fCTPTimeParams; fCTPTimeParams = NULL;
+ if (rec.fCTPTimeParams) fCTPTimeParams = new AliCTPTimeParams(*rec.fCTPTimeParams);
+
fRunLoader = NULL;
fRawReader = NULL;
fParentRawReader = NULL;
}
delete fGRPData;
delete fRunScalers;
+ delete fCTPTimeParams;
fOptions.Delete();
if (fAlignObjArray) {
fAlignObjArray->Delete();
void AliReconstruction::InitQA()
{
//Initialize the QA and start of cycle
- AliCodeTimerAuto("");
+ AliCodeTimerAuto("",0);
if (fInitQACalled) return;
fInitQACalled = kTRUE;
qam->SetCycleLength(AliQAv1::DETECTORINDEX_t(det), fQACycles[det]) ;
qam->SetWriteExpert(AliQAv1::DETECTORINDEX_t(det)) ;
}
- if (!fRawReader && !fInput && fQATasks.Contains(AliQAv1::kRAWS))
+ if (!fRawReader && !fInput && IsInTasks(AliQAv1::kRAWS))
fQATasks.ReplaceAll(Form("%d",AliQAv1::kRAWS), "") ;
qam->SetTasks(fQATasks) ;
qam->InitQADataMaker(AliCDBManager::Instance()->GetRun()) ;
Bool_t sameCycle = kFALSE ;
AliQADataMaker *qadm = qam->GetQADataMaker(AliQAv1::kGLOBAL);
AliInfo(Form("Initializing the global QA data maker"));
- if (fQATasks.Contains(Form("%d", AliQAv1::kRECPOINTS))) {
+ if (IsInTasks(AliQAv1::kRECPOINTS)) {
qadm->StartOfCycle(AliQAv1::kRECPOINTS, AliCDBManager::Instance()->GetRun(), sameCycle) ;
TObjArray **arr=qadm->Init(AliQAv1::kRECPOINTS);
AliTracker::SetResidualsArray(arr);
sameCycle = kTRUE ;
}
- if (fQATasks.Contains(Form("%d", AliQAv1::kESDS))) {
+ if (IsInTasks(AliQAv1::kESDS)) {
qadm->StartOfCycle(AliQAv1::kESDS, AliCDBManager::Instance()->GetRun(), sameCycle) ;
qadm->Init(AliQAv1::kESDS);
}
void AliReconstruction::MergeQA(const char *fileName)
{
//Initialize the QA and start of cycle
- AliCodeTimerAuto("") ;
+ AliCodeTimerAuto("",0) ;
AliQAManager::QAManager()->Merge(AliCDBManager::Instance()->GetRun(),fileName) ;
AliSysInfo::AddStamp("MergeQA") ;
}
// activate a default CDB storage
// First check if we have any CDB storage set, because it is used
// to retrieve the calibration and alignment constants
- AliCodeTimerAuto("");
+ AliCodeTimerAuto("",0);
if (fInitCDBCalled) return;
fInitCDBCalled = kTRUE;
//_____________________________________________________________________________
Bool_t AliReconstruction::LoadCDB()
{
- AliCodeTimerAuto("");
+ AliCodeTimerAuto("",0);
AliCDBManager::Instance()->Get("GRP/CTP/Config");
if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
AliCDBManager::Instance()->GetAll(Form("%s/Calib/*",fgkDetectorName[iDet]));
}
+
+ // Temporary fix - one has to define the correct policy in order
+ // to load the trigger OCDB entries only for the detectors that
+ // in the trigger or that are needed in order to put correct
+ // information in ESD
+ AliCDBManager::Instance()->GetAll("TRIGGER/*/*");
+
return kTRUE;
}
//_____________________________________________________________________________
Bool_t AliReconstruction::LoadTriggerScalersCDB()
{
- AliCodeTimerAuto("");
+ AliCodeTimerAuto("",0);
AliCDBEntry* entry = AliCDBManager::Instance()->Get("GRP/CTP/Scalers");
return kTRUE;
}
//_____________________________________________________________________________
+Bool_t AliReconstruction::LoadCTPTimeParamsCDB()
+{
+ AliCDBEntry* entry = AliCDBManager::Instance()->Get("GRP/CTP/CTPtiming");
+
+ if (entry) {
+
+ AliInfo("Found an AliCTPTimeParams in GRP/CTP/CTPtiming, reading it");
+ fCTPTimeParams = dynamic_cast<AliCTPTimeParams*> (entry->GetObject());
+ entry->SetOwner(0);
+ return kTRUE;
+ }
+
+ return kFALSE;
+}
+//_____________________________________________________________________________
Bool_t AliReconstruction::Run(const char* input)
{
// Run Run Run
- AliCodeTimerAuto("");
+ AliCodeTimerAuto("",0);
InitRun(input);
if (GetAbort() != TSelector::kContinue) return kFALSE;
//_____________________________________________________________________________
void AliReconstruction::InitRawReader(const char* input)
{
- AliCodeTimerAuto("");
+ AliCodeTimerAuto("",0);
// Init raw-reader and
// set the input in case of raw data
if (input) fRawInput = input;
fRawReader = AliRawReader::Create(fRawInput.Data());
- if (!fRawReader)
- AliInfo("Reconstruction will run over digits");
+ if (!fRawReader) {
+ if (fRawInput.IsNull()) {
+ AliInfo("Reconstruction will run over digits");
+ }
+ else {
+ AliFatal("Can not create raw-data reader ! Exiting...");
+ }
+ }
if (!fEquipIdMap.IsNull() && fRawReader)
fRawReader->LoadEquipmentIdsMap(fEquipIdMap);
{
// Initialization of raw-reader,
// run number, CDB etc.
- AliCodeTimerAuto("");
+ AliCodeTimerAuto("",0);
AliSysInfo::AddStamp("Start");
// Initialize raw-reader if any
// going into the event loop
// Should follow the TSelector convention
// i.e. initialize only the object on the client side
- AliCodeTimerAuto("");
+ AliCodeTimerAuto("",0);
AliReconstruction *reco = NULL;
if (fInput) {
}
AliSysInfo::AddStamp("LoadTriggerScalersCDB");
+ if (!LoadCTPTimeParamsCDB()) {
+ Abort("LoadCTPTimeParamsCDB", TSelector::kAbortProcess);
+ return;
+ }
+ AliSysInfo::AddStamp("LoadCTPTimeParamsCDB");
// Read the reconstruction parameters from OCDB
if (!InitRecoParams()) {
// Initialization related to run-loader,
// vertexer, trackers, recontructors
// In proof mode it is executed on the slave
- AliCodeTimerAuto("");
+ AliCodeTimerAuto("",0);
TProofOutputFile *outProofFile = NULL;
if (fInput) {
if (AliDebugLevel() > 0) fInput->Print();
+ if (AliDebugLevel() > 10) fInput->Dump();
if (AliReconstruction *reco = (AliReconstruction*)fInput->FindObject("AliReconstruction")) {
*this = *reco;
}
}
}
if (AliMagF *map = (AliMagF*)fInput->FindObject("MagneticFieldMap")) {
- TGeoGlobalMagField::Instance()->SetField(map);
+ AliMagF *newMap = new AliMagF(*map);
+ if (!newMap->LoadParameterization()) {
+ Abort("AliMagF::LoadParameterization", TSelector::kAbortProcess);
+ return;
+ }
+ TGeoGlobalMagField::Instance()->SetField(newMap);
+ TGeoGlobalMagField::Instance()->Lock();
}
if (TNamed *outputFileName = (TNamed*)fInput->FindObject("PROOF_OUTPUTFILE"))
fProofOutputFileName = outputFileName->GetTitle();
fesd = new AliESDEvent();
fesd->CreateStdContent();
+ // add a so far non-std object to the ESD, this will
+ // become part of the std content
+ fesd->AddObject(new AliESDHLTDecision);
+
fesd->WriteToTree(ftree);
if (fWriteESDfriend) {
// careful:
{
// run the reconstruction over a single entry
// from the chain with raw data
- AliCodeTimerAuto("");
+ AliCodeTimerAuto("",0);
TTree *currTree = fChain->GetTree();
AliRawVEvent *event = NULL;
// run the reconstruction over a single event
// The event loop is steered in Run method
- AliCodeTimerAuto("");
+ AliCodeTimerAuto("",0);
if (iEvent >= fRunLoader->GetNumberOfEvents()) {
fRunLoader->SetEventNumber(iEvent);
if (reconstructor && fRecoParam.GetDetRecoParamArray(iDet)) {
const AliDetectorRecoParam *par = fRecoParam.GetDetRecoParam(iDet);
reconstructor->SetRecoParam(par);
- reconstructor->SetEventInfo(&fEventInfo);
+ reconstructor->SetEventInfo(&fEventInfo);
if (fRunQA) {
AliQAManager::QAManager()->SetRecoParam(iDet, par) ;
AliQAManager::QAManager()->SetEventSpecie(AliRecoParam::Convert(par->GetEventSpecie())) ;
}
}
}
+ const AliDetectorRecoParam *grppar = fRecoParam.GetDetRecoParam(kNDetectors);
+ AliQAManager::QAManager()->SetRecoParam(AliQAv1::kGLOBAL, grppar) ;
+ AliQAManager::QAManager()->SetEventSpecie(AliRecoParam::Convert(grppar->GetEventSpecie())) ;
}
// QA on single raw
- if (fRunQA) {
+ if (fRunQA && IsInTasks(AliQAv1::kRAWS)) {
AliQAManager::QAManager()->SetEventSpecie(fRecoParam.GetEventSpecie()) ;
AliQAManager::QAManager()->RunOneEvent(fRawReader) ;
}
detectors=fRunLocalReconstruction;
detectors.ReplaceAll("HLT", "");
if (!RunLocalEventReconstruction(detectors)) {
- if (fStopOnError) {CleanUp(); return kFALSE;}
+ if (fStopOnError) {
+ CleanUp();
+ return kFALSE;
+ }
}
}
fhltesd->SetRunNumber(fRunLoader->GetHeader()->GetRun());
fesd->SetEventNumberInFile(fRunLoader->GetHeader()->GetEventNrInRun());
fhltesd->SetEventNumberInFile(fRunLoader->GetHeader()->GetEventNrInRun());
+
+ fesd->SetEventSpecie(fRecoParam.GetEventSpecie());
+ fhltesd->SetEventSpecie(fRecoParam.GetEventSpecie());
// Set magnetic field from the tracker
fesd->SetMagneticField(AliTracker::GetBz());
t->RelateToVertexBxByBz(pvtx, b, kVeryBig);
}
}
+ delete pvtx; pvtx=NULL;
}
// TPC-only primary vertex
t->RelateToVertexTPCBxByBz(pvtx, b, kVeryBig);
}
}
+ delete pvtx; pvtx=NULL;
}
}
// write ESD
if (fCleanESD) CleanESD(fesd);
- if (fRunQA) {
+ if (fRunQA && IsInTasks(AliQAv1::kESDS)) {
AliQAManager::QAManager()->SetEventSpecie(fRecoParam.GetEventSpecie()) ;
- AliQAManager::QAManager()->RunOneEvent(fesd) ;
+ AliQAManager::QAManager()->RunOneEvent(fesd, fhltesd) ;
}
if (fRunGlobalQA) {
AliQADataMaker *qadm = AliQAManager::QAManager()->GetQADataMaker(AliQAv1::kGLOBAL);
qadm->SetEventSpecie(fRecoParam.GetEventSpecie()) ;
- if (qadm && fQATasks.Contains(Form("%d", AliQAv1::kESDS)))
+ if (qadm && IsInTasks(AliQAv1::kESDS))
qadm->Exec(AliQAv1::kESDS, fesd);
}
+ // copy HLT decision from HLTesd to esd
+ // the most relevant information is stored in a reduced container in the esd,
+ // while the full information can be found in the HLTesd
+ TObject* pHLTSrc=fhltesd->FindListObject(AliESDHLTDecision::Name());
+ TObject* pHLTTgt=fesd->FindListObject(AliESDHLTDecision::Name());
+ if (pHLTSrc && pHLTTgt) {
+ pHLTSrc->Copy(*pHLTTgt);
+ }
+
if (fWriteESDfriend) {
// fesdf->~AliESDfriend();
// new (fesdf) AliESDfriend(); // Reset...
// Finalize the run on the slave side
// Called after the exit
// from the event loop
- AliCodeTimerAuto("");
+ AliCodeTimerAuto("",0);
if (fIsNewRunLoader) { // galice.root didn't exist
fRunLoader->WriteHeader("OVERWRITE");
}
// End of cycle for the in-loop
- if (fRunQA)
- AliQAManager::QAManager()->EndOfCycle() ;
-
- if (fRunGlobalQA) {
- AliQADataMaker *qadm = AliQAManager::QAManager()->GetQADataMaker(AliQAv1::kGLOBAL);
- if (qadm) {
- if (fQATasks.Contains(Form("%d", AliQAv1::kRECPOINTS)))
- qadm->EndOfCycle(AliQAv1::kRECPOINTS);
- if (fQATasks.Contains(Form("%d", AliQAv1::kESDS)))
- qadm->EndOfCycle(AliQAv1::kESDS);
- qadm->Finish();
- }
- }
if (fRunQA || fRunGlobalQA) {
+ AliQAManager::QAManager()->EndOfCycle() ;
if (fInput &&
!fProofOutputLocation.IsNull() &&
fProofOutputArchive.IsNull() &&
{
// Create tags for the events in the ESD tree (the ESD tree is always present)
// In case of empty events the tags will contain dummy values
- AliCodeTimerAuto("");
+ AliCodeTimerAuto("",0);
// Do not call the ESD tag creator in case of PROOF-based reconstruction
if (!fInput) {
AliESDTagCreator *esdtagCreator = new AliESDTagCreator();
esdtagCreator->CreateESDTags(fFirstEvent,fLastEvent,fGRPData, AliQAv1::Instance()->GetQA(), AliQAv1::Instance()->GetEventSpecies(), AliQAv1::kNDET, AliRecoParam::kNSpecies);
+ delete esdtagCreator;
}
// Cleanup of CDB manager: cache and active storages!
// run the local reconstruction
static Int_t eventNr=0;
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
TString detStr = detectors;
for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
AliInfo(Form("converting raw data digits into root objects for %s",
fgkDetectorName[iDet]));
// AliCodeTimerAuto(Form("converting raw data digits into root objects for %s",
-// fgkDetectorName[iDet]));
+// fgkDetectorName[iDet]),0);
loader->LoadDigits("update");
loader->CleanDigits();
loader->MakeDigitsContainer();
}
// local reconstruction
AliInfo(Form("running reconstruction for %s", fgkDetectorName[iDet]));
- //AliCodeTimerAuto(Form("running reconstruction for %s", fgkDetectorName[iDet]));
+ //AliCodeTimerAuto(Form("running reconstruction for %s", fgkDetectorName[iDet]),0);
loader->LoadRecPoints("update");
loader->CleanRecPoints();
loader->MakeRecPointsContainer();
TTree* digitsTree = loader->TreeD();
if (!digitsTree) {
AliError(Form("Can't get the %s digits tree", fgkDetectorName[iDet]));
- if (fStopOnError) return kFALSE;
+ if (fStopOnError)
+ return kFALSE;
} else {
reconstructor->Reconstruct(digitsTree, clustersTree);
- if (fRunQA) {
+ if (fRunQA && IsInTasks(AliQAv1::kDIGITSR)) {
AliQAManager::QAManager()->SetEventSpecie(fRecoParam.GetEventSpecie()) ;
AliQAManager::QAManager()->RunOneEventInOneDetector(iDet, digitsTree) ;
}
}
loader->UnloadDigits();
}
- if (fRunQA) {
+ if (fRunQA && IsInTasks(AliQAv1::kRECPOINTS)) {
AliQAManager::QAManager()->SetEventSpecie(fRecoParam.GetEventSpecie()) ;
AliQAManager::QAManager()->RunOneEventInOneDetector(iDet, clustersTree) ;
}
loader->UnloadRecPoints();
AliSysInfo::AddStamp(Form("LRec%s_%d",fgkDetectorName[iDet],eventNr), iDet,1,eventNr);
}
+ IsSelected("CTP", detStr);
if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) {
AliError(Form("the following detectors were not found: %s",
detStr.Data()));
- if (fStopOnError) return kFALSE;
+ if (fStopOnError)
+ return kFALSE;
}
eventNr++;
return kTRUE;
{
// run the SPD trackleting (for SPD efficiency purpouses)
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
Double_t vtxPos[3] = {0, 0, 0};
Double_t vtxErr[3] = {0.0, 0.0, 0.0};
{
// run the barrel tracking
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
AliVertexer *vertexer = CreateVertexer();
if (!vertexer) return kFALSE;
{
// run the HLT barrel tracking
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
if (!fRunLoader) {
AliError("Missing runLoader!");
{
// run the muon spectrometer tracking
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
if (!fRunLoader) {
AliError("Missing runLoader!");
Int_t rv = tracker->Clusters2Tracks(esd);
- if ( rv )
- {
- AliError(Form("%s Clusters2Tracks failed", fgkDetectorName[iDet]));
- return kFALSE;
- }
-
fLoader[iDet]->UnloadRecPoints();
tracker->UnloadClusters();
delete tracker;
+ if ( rv )
+ {
+ AliError(Form("%s Clusters2Tracks failed", fgkDetectorName[iDet]));
+ return kFALSE;
+ }
+
return kTRUE;
}
{
// run the barrel tracking
static Int_t eventNr=0;
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
AliInfo("running tracking");
{
// fill the event summary data
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
static Int_t eventNr=0;
TString detStr = detectors;
fLoader[iDet]->UnloadRecPoints();
}
}
-
+
+ IsSelected("CTP", detStr);
if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) {
AliError(Form("the following detectors were not found: %s",
detStr.Data()));
// stored in Trigger.root file and fills
// the corresponding esd entries
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
AliInfo("Filling trigger information into the ESD");
//AliTimeStamp* timestamp = new AliTimeStamp(10308000, 0, (ULong64_t)486238);
AliESDHeader* esdheader = fesd->GetHeader();
for(Int_t i=0;i<50;i++){
- if((1<<i) & esd->GetTriggerMask()){
+ if((1ull<<i) & esd->GetTriggerMask()){
AliTriggerScalersESD* scalesd = fRunScalers->GetScalersForEventClass( timestamp, i+1);
if(scalesd)esdheader->SetTriggerScalersRecord(scalesd);
}
AliQAManager::QAManager()->ShowQA() ;
AliQAManager::Destroy() ;
- TGeoGlobalMagField::Instance()->SetField(NULL);
}
void AliReconstruction::WriteAlignmentData(AliESDEvent* esd)
Int_t idx[200];
for (Int_t i=0; i<200; ++i) idx[i] = -1; //PH avoid uninitialized values
for (Int_t iDet = 5; iDet >= 0; iDet--) {// TOF, TRD, TPC, ITS clusters
- nsp += track->GetNcls(iDet);
+ nsp += (iDet==GetDetIndex("TRD")) ? track->GetTRDntracklets():track->GetNcls(iDet);
- if (iDet==0) { // ITS "extra" clusters
+ if (iDet==GetDetIndex("ITS")) { // ITS "extra" clusters
track->GetClusters(iDet,idx);
for (Int_t i=6; i<12; i++) if(idx[i] >= 0) nsp++;
}
for (Int_t iDet = 5; iDet >= 0; iDet--) {
AliTracker *tracker = fTracker[iDet];
if (!tracker) continue;
- Int_t nspdet = track->GetClusters(iDet,idx);
+ Int_t nspdet = (iDet==GetDetIndex("TRD")) ? track->GetTRDtracklets(idx):track->GetClusters(iDet,idx);
- if (iDet==0) // ITS "extra" clusters
+ if (iDet==GetDetIndex("ITS")) // ITS "extra" clusters
for (Int_t i=6; i<12; i++) if(idx[i] >= 0) nspdet++;
if (nspdet <= 0) continue;
}
isp2++;
if (!isvalid) continue;
- if (iDet==0 && (isp-1)>=6) p.SetExtra();
+ if (iDet==GetDetIndex("ITS") && (isp-1)>=6) p.SetExtra();
sp->AddPoint(isptrack,&p); isptrack++;
}
}
// Return: kTRUE if all operations have been done properly, kFALSE otherwise
//
Bool_t ret=kFALSE;
+ TString detStr = fLoadCDB;
//for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
for (Int_t iDet = 0; iDet < 1; iDet++) { // for the time being only ITS
- //if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
+ if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
if(fTracker[iDet] && fTracker[iDet]->GetPlaneEff()) {
AliPlaneEff *planeeff=fTracker[iDet]->GetPlaneEff();
TString name=planeeff->GetName();
AliWarning(Form("Implementation of this method not yet completed !! Method return kTRUE"));
fSPDTrackleter = NULL;
- AliReconstructor* itsReconstructor = GetReconstructor(0);
- if (itsReconstructor) {
- fSPDTrackleter = itsReconstructor->CreateTrackleter(); // this is NULL unless required in RecoParam
- }
- if (fSPDTrackleter) {
- AliInfo("Trackleter for SPD has been created");
+ TString detStr = fLoadCDB;
+ if (IsSelected(fgkDetectorName[0], detStr)) {
+ AliReconstructor* itsReconstructor = GetReconstructor(0);
+ if (itsReconstructor) {
+ fSPDTrackleter = itsReconstructor->CreateTrackleter(); // this is NULL unless required in RecoParam
+ }
+ if (fSPDTrackleter) {
+ AliInfo("Trackleter for SPD has been created");
+ }
}
-
return kTRUE;
}
}
Int_t colon = detAndAction.Index(":") ;
fQADetectors = detAndAction(0, colon) ;
- if (fQADetectors.Contains("ALL") )
- fQADetectors = fFillESD ;
- fQATasks = detAndAction(colon+1, detAndAction.Sizeof() ) ;
+ fQATasks = detAndAction(colon+1, detAndAction.Sizeof() ) ;
if (fQATasks.Contains("ALL") ) {
fQATasks = Form("%d %d %d %d", AliQAv1::kRAWS, AliQAv1::kDIGITSR, AliQAv1::kRECPOINTS, AliQAv1::kESDS) ;
} else {
{
// Fill the event info object
// ...
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
AliCentralTrigger *aCTP = NULL;
if (fRawReader) {