]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliReconstruction.cxx
By default all events go into one run-loader's file. Allows to remove the correspondi...
[u/mrichter/AliRoot.git] / STEER / AliReconstruction.cxx
index 4e3f8d321dad1397cc96bf77e6d977f5c04ad3b4..c6fa3501186a694f2357ab0cc08dac15d7ebe6dc 100644 (file)
@@ -231,7 +231,7 @@ AliReconstruction::AliReconstruction(const char* gAliceFilename) :
   fEquipIdMap(""),
   fFirstEvent(0),
   fLastEvent(-1),
-  fNumberOfEventsPerFile(1),
+  fNumberOfEventsPerFile((UInt_t)-1),
   fOptions(),
   fLoadAlignFromCDB(kTRUE),
   fLoadAlignData("ALL"),
@@ -711,13 +711,15 @@ Bool_t AliReconstruction::MisalignGeometry(const TString& detectors)
     for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
       if(!IsSelected(fgkDetectorName[iDet], detStr)) continue;
       if(!strcmp(fgkDetectorName[iDet],"HLT")) continue;
-      if(AliGeomManager::IsModuleInGeom(fgkDetectorName[iDet]))
+      
+      if(AliGeomManager::GetNalignable(fgkDetectorName[iDet]) != 0)
       {
        loadAlObjsListOfDets += fgkDetectorName[iDet];
        loadAlObjsListOfDets += " ";
       }
     } // end loop over detectors
-    if(AliGeomManager::IsModuleInGeom("FRAME"))
+    
+    if(AliGeomManager::GetNalignable("GRP") != 0)
       loadAlObjsListOfDets.Prepend("GRP "); //add alignment objects for non-sensitive modules
     AliGeomManager::ApplyAlignObjsFromCDB(loadAlObjsListOfDets.Data());
     AliCDBManager::Instance()->UnloadFromCache("*/Align/*");
@@ -936,21 +938,28 @@ Bool_t AliReconstruction::InitGRP() {
   // Process the list of active detectors
   if (activeDetectors) {
     UInt_t detMask = activeDetectors;
+    fRunLocalReconstruction = MatchDetectorList(fRunLocalReconstruction,detMask);
+    fRunTracking = MatchDetectorList(fRunTracking,detMask);
+    fFillESD = MatchDetectorList(fFillESD,detMask);
+    fQADetectors = MatchDetectorList(fQADetectors,detMask);
     fLoadCDB.Form("%s %s %s %s",
                  fRunLocalReconstruction.Data(),
                  fRunTracking.Data(),
                  fFillESD.Data(),
                  fQADetectors.Data());
-    fRunLocalReconstruction = MatchDetectorList(fRunLocalReconstruction,detMask);
-    fRunTracking = MatchDetectorList(fRunTracking,detMask);
-    fFillESD = MatchDetectorList(fFillESD,detMask);
-    fQADetectors = MatchDetectorList(fQADetectors,detMask);
     fLoadCDB = MatchDetectorList(fLoadCDB,detMask);
     if (!((detMask >> AliDAQ::DetectorID("ITSSPD")) & 0x1)) {
       // switch off the vertexer
       AliInfo("SPD is not in the list of active detectors. Vertexer switched off.");
       fRunVertexFinder = kFALSE;
     }
+    if (!((detMask >> AliDAQ::DetectorID("TRG")) & 0x1)) {
+      // switch off the reading of CTP raw-data payload
+      if (fFillTriggerESD) {
+       AliInfo("CTP is not in the list of active detectors. CTP data reading switched off.");
+       fFillTriggerESD = kFALSE;
+      }
+    }
   }
 
   AliInfo("===================================================================================");
@@ -1493,6 +1502,7 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
   // Fill Event-info object
   GetEventInfo();
   fRecoParam.SetEventSpecie(fRunInfo,fEventInfo);
+  AliInfo(Form("Current event specie: %s",fRecoParam.PrintEventSpecie()));
 
   // Set the reco-params
   {
@@ -1629,7 +1639,7 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
       ok = kFALSE;
       if (tpcTrack)
        ok = AliTracker::
-         PropagateTrackTo(tpcTrack,kRadius,track->GetMass(),kMaxStep,kTRUE);
+         PropagateTrackTo(tpcTrack,kRadius,track->GetMass(),kMaxStep,kFALSE);
 
       if (ok) {
        Int_t n=trkArray.GetEntriesFast();
@@ -1641,7 +1651,7 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
       if (track->IsOn(AliESDtrack::kITSrefit)) continue;
 
       AliTracker::
-         PropagateTrackTo(track,kRadius,track->GetMass(),kMaxStep,kTRUE);
+         PropagateTrackTo(track,kRadius,track->GetMass(),kMaxStep,kFALSE);
       track->RelateToVertex(fesd->GetPrimaryVertexSPD(), kBz, kVeryBig);
 
     }
@@ -1674,7 +1684,7 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
        AliESDVertex *pvtx=ftVertexer->FindPrimaryVertex(fesd);
        if (pvtx) {
           if (pvtx->GetStatus()) {
-             fesd->SetPrimaryVertex(pvtx);
+             fesd->SetPrimaryVertexTracks(pvtx);
              for (Int_t i=0; i<ntracks; i++) {
                 AliESDtrack *t = fesd->GetTrack(i);
                  t->RelateToVertex(pvtx, kBz, kVeryBig);
@@ -2143,7 +2153,9 @@ Bool_t AliReconstruction::RunTracking(AliESDEvent*& esd)
   if (fReconstructor[11] && fLoader[11]) {
     fLoader[11]->LoadRecPoints("READ");
     TTree *treeR = fLoader[11]->TreeR();
-    GetReconstructor(11)->FillESD((TTree *)NULL,treeR,esd);
+    if (treeR) {
+      GetReconstructor(11)->FillESD((TTree *)NULL,treeR,esd);
+    }
   }
 
   // pass 1: TPC + ITS inwards
@@ -2687,7 +2699,7 @@ void AliReconstruction::WriteAlignmentData(AliESDEvent* esd)
       AliESDtrack *track = esd->GetTrack(itrack);
       Int_t nsp = 0;
       Int_t idx[200];
-      for (Int_t iDet = 3; iDet >= 0; iDet--) {// TOF, TRD, TPC, ITS clusters
+      for (Int_t iDet = 5; iDet >= 0; iDet--) {// TOF, TRD, TPC, ITS clusters
           nsp += track->GetNcls(iDet);
 
           if (iDet==0) { // ITS "extra" clusters
@@ -2700,7 +2712,7 @@ void AliReconstruction::WriteAlignmentData(AliESDEvent* esd)
        AliTrackPointArray *sp = new AliTrackPointArray(nsp);
        track->SetTrackPointArray(sp);
        Int_t isptrack = 0;
-       for (Int_t iDet = 3; iDet >= 0; iDet--) {
+       for (Int_t iDet = 5; iDet >= 0; iDet--) {
          AliTracker *tracker = fTracker[iDet];
          if (!tracker) continue;
          Int_t nspdet = track->GetClusters(iDet,idx);
@@ -3093,8 +3105,9 @@ Bool_t AliReconstruction::GetEventInfo()
   for( Int_t iclass=0; iclass < nclasses; iclass++ ) {
     AliTriggerClass* trclass = (AliTriggerClass*)classesArray.At(iclass);
     if (trclass) {
-      Int_t trindex = (Int_t)TMath::Log2(trclass->GetMask());
+      Int_t trindex = TMath::Nint(TMath::Log2(trclass->GetMask()));
       fesd->SetTriggerClass(trclass->GetName(),trindex);
+      if (fRawReader) fRawReader->LoadTriggerClass(trclass->GetName(),trindex);
       if (trmask & (1 << trindex)) {
        trclasses += " ";
        trclasses += trclass->GetName();
@@ -3136,12 +3149,15 @@ const char *AliReconstruction::MatchDetectorList(const char *detectorList, UInt_
     if ((detectorMask >> iDet) & 0x1) {
       TString det = AliDAQ::OfflineModuleName(iDet);
       if ((detList.CompareTo("ALL") == 0) ||
-         detList.BeginsWith("ALL ") ||
-         detList.EndsWith(" ALL") ||
-         detList.Contains(" ALL ") ||
+         ((detList.BeginsWith("ALL ") ||
+           detList.EndsWith(" ALL") ||
+           detList.Contains(" ALL ")) &&
+          !(detList.BeginsWith("-"+det+" ") ||
+            detList.EndsWith(" -"+det) ||
+            detList.Contains(" -"+det+" "))) ||
          (detList.CompareTo(det) == 0) ||
-         detList.BeginsWith(det) ||
-         detList.EndsWith(det) ||
+         detList.BeginsWith(det+" ") ||
+         detList.EndsWith(" "+det) ||
          detList.Contains( " "+det+" " )) {
        if (!resultList.EndsWith(det + " ")) {
          resultList += det;
@@ -3155,12 +3171,15 @@ const char *AliReconstruction::MatchDetectorList(const char *detectorList, UInt_
   if ((detectorMask >> AliDAQ::kHLTId) & 0x1) {
     TString hltDet = AliDAQ::OfflineModuleName(AliDAQ::kNDetectors-1);
     if ((detList.CompareTo("ALL") == 0) ||
-       detList.BeginsWith("ALL ") ||
-       detList.EndsWith(" ALL") ||
-       detList.Contains(" ALL ") ||
+       ((detList.BeginsWith("ALL ") ||
+         detList.EndsWith(" ALL") ||
+         detList.Contains(" ALL ")) &&
+        !(detList.BeginsWith("-"+hltDet+" ") ||
+          detList.EndsWith(" -"+hltDet) ||
+          detList.Contains(" -"+hltDet+" "))) ||
        (detList.CompareTo(hltDet) == 0) ||
-       detList.BeginsWith(hltDet) ||
-       detList.EndsWith(hltDet) ||
+       detList.BeginsWith(hltDet+" ") ||
+       detList.EndsWith(" "+hltDet) ||
        detList.Contains( " "+hltDet+" " )) {
       resultList += hltDet;
     }