#include <TGrid.h>
#include <TMessage.h>
#include <TUrl.h>
+#include <TRandom.h>
#include "AliAlignObj.h"
#include "AliCDBEntry.h"
#include "AliTriggerConfiguration.h"
#include "AliV0vertexer.h"
#include "AliVertexer.h"
+#include "AliTrackleter.h"
#include "AliVertexerTracks.h"
#include "AliTriggerRunScalers.h"
#include "AliCTPTimeParams.h"
#include "AliESDHLTDecision.h"
#include "AliTriggerInput.h"
+#include "AliLHCData.h"
ClassImp(AliReconstruction)
//_____________________________________________________________________________
fRunMuonTracking(kFALSE),
fRunV0Finder(kTRUE),
fRunCascadeFinder(kTRUE),
+ fRunMultFinder(kTRUE),
fStopOnError(kTRUE),
fWriteAlignmentData(kFALSE),
fWriteESDfriend(kFALSE),
fFirstEvent(0),
fLastEvent(-1),
fNumberOfEventsPerFile((UInt_t)-1),
+ fFractionFriends(0.04),
fOptions(),
fLoadAlignFromCDB(kTRUE),
fLoadAlignData("ALL"),
fQACycles[iDet] = 999999 ;
fQAWriteExpert[iDet] = kFALSE ;
}
-
+ fBeamInt[0][0]=fBeamInt[0][1]=fBeamInt[1][0]=fBeamInt[1][1] = -1;
+
AliPID pid;
}
fRunMuonTracking(rec.fRunMuonTracking),
fRunV0Finder(rec.fRunV0Finder),
fRunCascadeFinder(rec.fRunCascadeFinder),
+ fRunMultFinder(rec.fRunMultFinder),
fStopOnError(rec.fStopOnError),
fWriteAlignmentData(rec.fWriteAlignmentData),
fWriteESDfriend(rec.fWriteESDfriend),
fFirstEvent(rec.fFirstEvent),
fLastEvent(rec.fLastEvent),
fNumberOfEventsPerFile(rec.fNumberOfEventsPerFile),
+ fFractionFriends(rec.fFractionFriends),
fOptions(),
fLoadAlignFromCDB(rec.fLoadAlignFromCDB),
fLoadAlignData(rec.fLoadAlignData),
for (Int_t i = 0; i < rec.fSpecCDBUri.GetEntriesFast(); i++) {
if (rec.fSpecCDBUri[i]) fSpecCDBUri.Add(rec.fSpecCDBUri[i]->Clone());
}
+
+ for (int i=2;i--;) for (int j=2;j--;) fBeamInt[i][j] = rec.fBeamInt[i][j];
+
}
//_____________________________________________________________________________
fRunMuonTracking = rec.fRunMuonTracking;
fRunV0Finder = rec.fRunV0Finder;
fRunCascadeFinder = rec.fRunCascadeFinder;
+ fRunMultFinder = rec.fRunMultFinder;
fStopOnError = rec.fStopOnError;
fWriteAlignmentData = rec.fWriteAlignmentData;
fWriteESDfriend = rec.fWriteESDfriend;
fFirstEvent = rec.fFirstEvent;
fLastEvent = rec.fLastEvent;
fNumberOfEventsPerFile = rec.fNumberOfEventsPerFile;
+ fFractionFriends = rec.fFractionFriends;
for (Int_t i = 0; i < rec.fOptions.GetEntriesFast(); i++) {
if (rec.fOptions[i]) fOptions.Add(rec.fOptions[i]->Clone());
fInitQACalled = rec.fInitQACalled;
fWriteQAExpertData = rec.fWriteQAExpertData;
fRunPlaneEff = rec.fRunPlaneEff;
-
+ for (int i=2;i--;) for (int j=2;j--;) fBeamInt[i][j] = rec.fBeamInt[i][j];
fesd = NULL;
fhltesd = NULL;
fesdf = NULL;
!((detMask >> AliDAQ::DetectorID("ITSSDD")) & 0x1) &&
!((detMask >> AliDAQ::DetectorID("ITSSSD")) & 0x1) ) {
// switch off the vertexer
- AliInfo("SPD,SDD,SSD is not in the list of active detectors. Vertexer switched off.");
+ AliInfo("SPD,SDD,SSD is not in the list of active detectors. Vertexer and Trackleter are switched off.");
fRunVertexFinder = kFALSE;
+ fRunMultFinder = kFALSE;
}
if (!((detMask >> AliDAQ::DetectorID("TRG")) & 0x1)) {
// switch off the reading of CTP raw-data payload
return kFALSE;
}
+
+//_____________________________________________________________________________
+Bool_t AliReconstruction::ReadIntensityInfoCDB()
+{
+ // Load LHC DIP data
+ AliCDBEntry* entry = AliCDBManager::Instance()->Get("GRP/GRP/LHCData");
+
+ if (entry) {
+ AliInfo("Found an AliLHCData in GRP/GRP/LHCData, reading it");
+ AliLHCData* dipData = dynamic_cast<AliLHCData*> (entry->GetObject());
+ for (int ib=2;ib--;) {
+ double intI,intNI;
+ if (dipData->GetMeanIntensity(ib,intI,intNI)>=0) {
+ fBeamInt[ib][0] = intI;
+ fBeamInt[ib][1] = intNI;
+ }
+ }
+ return kTRUE;
+ }
+ return kFALSE;
+}
+
+
//_____________________________________________________________________________
Bool_t AliReconstruction::Run(const char* input)
{
}
AliSysInfo::AddStamp("LoadCTPTimeParamsCDB");
+ if (!ReadIntensityInfoCDB()) {
+ Abort("ReadIntensityInfoCDB", TSelector::kAbortProcess);
+ return;
+ }
+ AliSysInfo::AddStamp("ReadIntensityInfoCDB");
+
// Read the reconstruction parameters from OCDB
if (!InitRecoParams()) {
AliWarning("Not all detectors have correct RecoParam objects initialized");
fesd->SetMagneticField(AliTracker::GetBz());
fhltesd->SetMagneticField(AliTracker::GetBz());
//
- ((AliESDRun*)fesd->GetESDRun())->SetBeamEnergyIsSqrtSHalfGeV();
- ((AliESDRun*)fhltesd->GetESDRun())->SetBeamEnergyIsSqrtSHalfGeV();
+ AliESDRun *esdRun,*esdRunH;
+ esdRun = (AliESDRun*)fesd->GetESDRun();
+ esdRunH = (AliESDRun*)fhltesd->GetESDRun();
+ esdRun->SetBeamEnergyIsSqrtSHalfGeV();
+ esdRunH->SetBeamEnergyIsSqrtSHalfGeV();
+ //
+ for (int ib=2;ib--;) for (int it=2;it--;) {
+ esdRun->SetMeanIntensity(ib,it, fBeamInt[ib][it]);
+ esdRunH->SetMeanIntensity(ib,it, fBeamInt[ib][it]);
+ }
//
AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
if (fld) { // set info needed for field initialization
ftVertexer->SetITSMode();
ftVertexer->SetConstraintOff();
// get cuts for vertexer from AliGRPRecoParam
+ Bool_t constrSPD=kFALSE;
if (grpRecoParam) {
Int_t nCutsVertexer = grpRecoParam->GetVertexerTracksNCuts();
Double_t *cutsVertexer = new Double_t[nCutsVertexer];
grpRecoParam->GetVertexerTracksCutsITS(cutsVertexer);
ftVertexer->SetCuts(cutsVertexer);
delete [] cutsVertexer; cutsVertexer = NULL;
- if(fDiamondProfile && grpRecoParam->GetVertexerTracksConstraintITS()) {
- if(fDiamondProfile->GetXRes()<kRadius) ftVertexer->SetVtxStart(fDiamondProfile); // apply constraint only if sigmax is smaller than the beam pipe radius
+ if(grpRecoParam->GetVertexerTracksConstraintITS()) {
+ if(fDiamondProfile && fDiamondProfile->GetXRes()<kRadius){
+ ftVertexer->SetVtxStart(fDiamondProfile); // apply constraint only if sigmax is smaller than the beam pipe radius
+ }else{
+ if(fDiamondProfileSPD && fDiamondProfileSPD->GetXRes()<kRadius){
+ ftVertexer->SetVtxStart(fDiamondProfileSPD);
+ constrSPD=kTRUE;
+ }
+ }
}
}
AliESDVertex *pvtx=ftVertexer->FindPrimaryVertex(fesd);
if (pvtx) {
+ if(constrSPD){
+ TString title=pvtx->GetTitle();
+ title.Append("SPD");
+ pvtx->SetTitle(title);
+ }
if (pvtx->GetStatus()) {
fesd->SetPrimaryVertexTracks(pvtx);
for (Int_t i=0; i<ntracks; i++) {
}
delete[] selectedIdx;
- if(fDiamondProfile) fesd->SetDiamond(fDiamondProfile);
-
+ if(fDiamondProfile && fDiamondProfile->GetXRes()<kRadius) fesd->SetDiamond(fDiamondProfile);
+ else fesd->SetDiamond(fDiamondProfileSPD);
if (fRunV0Finder) {
// V0 finding
}
}
+ // RS run updated trackleter: since we want to mark the clusters used by tracks and also mark the
+ // tracks interpreted as primary, this step should be done in the very end, when full
+ // ESD info is available (particulalry, V0s)
+ // vertex finder
+ if (fRunMultFinder) {
+ if (!RunMultFinder(fesd)) {
+ if (fStopOnError) {CleanUp(); return kFALSE;}
+ }
+ }
+
// write ESD
if (fCleanESD) CleanESD(fesd);
fesd->GetESDfriend(fesdf);
ftree->Fill();
- if (fWriteESDfriend) ftreeF->Fill();
+ if (fWriteESDfriend) {
+ // Sampling
+ Double_t rnd = gRandom->Rndm();
+ if (fFractionFriends < rnd) {
+ fesdf->~AliESDfriend();
+ new (fesdf) AliESDfriend(); // Reset...
+ fesdf->SetSkipBit(kTRUE);
+ }
+
+ ftreeF->Fill();
+ }
// Auto-save the ESD tree in case of prompt reco @P2
if (fRawReader && fRawReader->UseAutoSaveESD()) {
AliVertexer *vertexer = CreateVertexer();
if (!vertexer) return kFALSE;
- AliInfo("running the ITS vertex finder");
+ AliInfo(Form("running the ITS vertex finder: %s",vertexer->ClassName()));
AliESDVertex* vertex = NULL;
if (fLoader[0]) {
fLoader[0]->LoadRecPoints();
if(novertices>1){
for (Int_t kk=1; kk<novertices; kk++)esd->AddPileupVertexSPD(&vpileup[kk]);
}
+ /*
// if SPD multiplicity has been determined, it is stored in the ESD
AliMultiplicity *mult = vertexer->GetMultiplicity();
if(mult)esd->SetMultiplicity(mult);
-
+ */
for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
if (fTracker[iDet]) fTracker[iDet]->SetVertex(vtxPos, vtxErr);
}
return kTRUE;
}
+//_____________________________________________________________________________
+Bool_t AliReconstruction::RunMultFinder(AliESDEvent*& esd)
+{
+ // run the trackleter for multiplicity study
+
+ AliCodeTimerAuto("",0)
+
+ AliTrackleter *trackleter = CreateMultFinder();
+ if (!trackleter) return kFALSE;
+
+ AliInfo(Form("running the ITS multiplicity finder: %s",trackleter->ClassName()));
+
+ if (fLoader[0]) {
+ fLoader[0]->LoadRecPoints();
+ TTree* cltree = fLoader[0]->TreeR();
+ if (cltree) {
+ trackleter->Reconstruct(esd,cltree);
+ AliMultiplicity *mult = trackleter->GetMultiplicity();
+ if(mult) esd->SetMultiplicity(mult);
+ }
+ else {
+ AliError("Can't get the ITS cluster tree");
+ }
+ fLoader[0]->UnloadRecPoints();
+ }
+ else {
+ AliError("Can't get the ITS loader");
+ }
+
+ delete trackleter;
+
+ return kTRUE;
+}
+
//_____________________________________________________________________________
Bool_t AliReconstruction::RunHLTTracking(AliESDEvent*& esd)
{
return vertexer;
}
+//_____________________________________________________________________________
+AliTrackleter* AliReconstruction::CreateMultFinder()
+{
+// create the ITS trackleter for mult. estimation
+// Please note that the caller is the owner of the
+// trackleter
+
+ AliTrackleter* trackleter = NULL;
+ AliReconstructor* itsReconstructor = GetReconstructor(0);
+ if (itsReconstructor && ((fRunLocalReconstruction.Contains("ITS")) || fRunTracking.Contains("ITS"))) {
+ trackleter = itsReconstructor->CreateMultFinder();
+ }
+ if (!trackleter) {
+ AliWarning("couldn't create a trackleter for ITS");
+ }
+
+ return trackleter;
+}
+
//_____________________________________________________________________________
Bool_t AliReconstruction::CreateTrackers(const TString& detectors)
{
continue;
}
-
fTracker[iDet] = reconstructor->CreateTracker();
if (!fTracker[iDet] && (iDet < 7)) {
AliWarning(Form("couldn't create a tracker for %s", detName.Data()));