]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliAODTagCreator.cxx
Removing the hard-wired particle masses (B. Hippolyte)
[u/mrichter/AliRoot.git] / STEER / AliAODTagCreator.cxx
index 322055196007913bfb183e63ec6eaae46d71024a..fe8dd235fb284a383836900df5b0b62a97893b82 100644 (file)
@@ -116,16 +116,18 @@ Bool_t AliAODTagCreator::ReadLocalCollection(const char *localpath) {
     sprintf(fPath,"%s/%s",localpath,dirname);
     void *dirb =  gSystem->OpenDirectory(fPath);
     while((filename = gSystem->GetDirEntry(dirb))) {
-      if(strstr(filename,pattern)) {
-       TString aodFileName;
-       aodFileName = fPath;
-       aodFileName += "/";
-       aodFileName += pattern;
-       fChain->Add(aodFileName);
-      }//pattern check
-    }//child directory's entry loop
-  }//parent directory's entry loop
-
+       TString bstr = dirname;
+       if(bstr.Contains("..")) continue;
+       if(strstr(filename,pattern)) {
+           TString aodFileName;
+           aodFileName = fPath;
+           aodFileName += "/";
+           aodFileName += pattern;
+           fChain->Add(aodFileName);
+       } //pattern check
+    } //child directory's entry loop
+  } //parent directory's entry loop
+  
   AliInfo(Form("AOD chain created......."));   
   AliInfo(Form("Chain entries: %d",fChain->GetEntries()));     
 
@@ -194,7 +196,7 @@ void AliAODTagCreator::CreateAODTags(Int_t fFirstEvent, Int_t fLastEvent, TList
  
     TFile* ftag = TFile::Open(fileName, "recreate");
 
-    AliRunTag *fRunTag = new AliRunTag();
+    fRunTag = new AliRunTag();
     fTreeT = new TTree("T","A Tree with event tags");
     TBranch * btag = fTreeT->Branch("AliTAG", &fRunTag);
     btag->SetCompressionLevel(9);
@@ -318,7 +320,7 @@ void AliAODTagCreator::CreateTags(const char* type)
        const TUrl *url = file->GetEndpointUrl();
        fguid = file->GetUUID().AsString();
 
-       if (type == "grid") {
+       if (!strcmp(type,"grid")) {
            TString fturltemp = "alien://"; fturltemp += url->GetFile();
            fturl = fturltemp(0,fturltemp.Index(".root",5,0,TString::kExact)+5);
        } else {
@@ -332,7 +334,7 @@ void AliAODTagCreator::CreateTags(const char* type)
        // Set the event and input file references
        evTag->SetEventId(iEventNumber+1);
        evTag->SetGUID(fguid);
-       if(type == "grid") {
+       if(!strcmp(type,"grid")) {
            evTag->SetMD5(0);
            evTag->SetTURL(fturl);
            evTag->SetSize(0);
@@ -386,7 +388,7 @@ void AliAODTagCreator::FillEventTag(AliAODEvent* aod, AliEventTag* evTag)
     Int_t   nPos = 0, nNeg = 0, nNeutr =0;
     Int_t   nKinks = 0, nV0s = 0, nCascades = 0;
     Int_t   nK0s = 0, nNeutrons = 0, nPi0s = 0, nGamas = 0;
-    Int_t   nProtons = 0,  nKaons = 0, nPions = 0, nMuons = 0, nElectrons = 0;
+    Int_t   nProtons = 0,  nKaons = 0, nPions = 0, nMuons = 0, nElectrons = 0, nFWMuons = 0;
     Int_t   nCh1GeV = 0, nCh3GeV = 0, nCh10GeV = 0;
     Int_t   nMu1GeV = 0, nMu3GeV = 0, nMu10GeV = 0;
     Int_t   nEl1GeV = 0, nEl3GeV = 0, nEl10GeV = 0;
@@ -448,10 +450,12 @@ void AliAODTagCreator::FillEventTag(AliAODEvent* aod, AliEventTag* evTag)
            if(fPt > fHighPtCut) nEl3GeV++;
            if(fPt > fVeryHighPtCut) nEl10GeV++;
        }
-           
        totalP += track->P();
        meanPt += fPt;
        ntrack++;
+       // forward muons (in the dimuon spectrometer)
+       if(track->IsMuonTrack()) nFWMuons++;   
+                                 
     }//track loop
     //
     // Fill the event tags  
@@ -472,6 +476,7 @@ void AliAODTagCreator::FillEventTag(AliAODEvent* aod, AliEventTag* evTag)
     evTag->SetNumOfKaons(nKaons);
     evTag->SetNumOfPions(nPions);
     evTag->SetNumOfMuons(nMuons);
+    evTag->SetNumOfFWMuons(nFWMuons);
     evTag->SetNumOfElectrons(nElectrons);
     evTag->SetNumOfPhotons(nGamas);
     evTag->SetNumOfPi0s(nPi0s);