]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/RESONANCES/AliRsnMonitor.cxx
Attempt to make the HV filtering more robust
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnMonitor.cxx
index ed8621f54be6c345f73cc7e7cca75bfbc3bafb79..2f1ab8e0083a8af2eabedd6475c6e2034944e5e8 100644 (file)
@@ -29,7 +29,7 @@ AliRsnMonitor::AliRsnMonitor(const char *name, AliRsnDaughterDef *def) :
    fCount(0),
    fDaughterDef(def),
    fCuts(Form("cuts_%s", name), AliRsnTarget::kDaughter),
-   fDaughter()
+   fDaughter(0)
 {
 //
 // Default constructor
@@ -93,17 +93,19 @@ Bool_t AliRsnMonitor::Fill(AliRsnDaughter *daughter)
 
    AliDebug(AliLog::kDebug + 2, "<-");
    
-   // assign mass
-   daughter->SetMass(fDaughterDef->GetMass());
-   
-   // if needed, check PID, type, charge
+   // check match with prototype
+   // include check on true PID if required
    if (!fDaughterDef->MatchesDaughter(daughter, fOnlyTrue)) return kFALSE;
+   
+   // if matching is successful
+   // update track data member and assigh default mass
+   fDaughter = daughter;
+   fDaughter->SetMass(fDaughterDef->GetMass());
 
    // check the cuts
    if (!fCuts.IsSelected(daughter)) return kFALSE;
    
-   // if track is accepted, copy do data member and increment counter
-   fDaughter = *daughter;
+   // if track is accepted increment counter   
    ++fCount;
 
    return kTRUE;