Added DCA variables to AliRsnValueDaughter (mvala)
authorfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 10 Oct 2012 10:14:34 +0000 (10:14 +0000)
committerfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 10 Oct 2012 10:14:34 +0000 (10:14 +0000)
PWGLF/RESONANCES/AliRsnValueDaughter.cxx
PWGLF/RESONANCES/AliRsnValueDaughter.h
PWGLF/RESONANCES/macros/lego_train/RsnConfig.C

index 6451dbc..7cf0592 100644 (file)
@@ -317,6 +317,53 @@ Bool_t AliRsnValueDaughter::Eval(TObject *object)
             fComputedValue = 0.0;
             return kFALSE;
          }
+      case kDCAXY:
+         if (track) {
+               AliESDtrack *trackESD = dynamic_cast<AliESDtrack*>(track);
+               if (trackESD) {
+                       Float_t b[2], bCov[3];
+                       trackESD->GetImpactParameters(b, bCov);
+                       fComputedValue =  b[0];
+               } else {
+                       Double_t b[2]={-999,-999}, cov[3];
+                       AliAODVertex *vertex = fEvent->GetRefAOD()->GetPrimaryVertex();
+                       if(vertex){
+                         track->PropagateToDCA(vertex, fEvent->GetRefAOD()->GetMagneticField(),kVeryBig, b, cov);
+                         fComputedValue = b[0];
+                       } else {
+                         fComputedValue = -999;
+                       }
+               }
+            return kTRUE;
+         } else {
+            AliWarning("Cannot get TPC chi^2 for non-track object");
+            fComputedValue = 0.0;
+            return kFALSE;
+         }
+      case kDCAZ:
+         if (track) {
+               AliESDtrack *trackESD = dynamic_cast<AliESDtrack*>(track);
+               if (trackESD) {
+                       Float_t b[2], bCov[3];
+                       trackESD->GetImpactParameters(b, bCov);
+                       fComputedValue =  b[1];
+               } else {
+                       Double_t b[2]={-999,-999}, cov[3];
+                       AliAODVertex *vertex = fEvent->GetRefAOD()->GetPrimaryVertex();
+                       if(vertex){
+                         track->PropagateToDCA(vertex, fEvent->GetRefAOD()->GetMagneticField(),kVeryBig, b, cov);
+                         fComputedValue = b[1];
+                       } else {
+                         fComputedValue = -999;
+                       }
+
+               }
+            return kTRUE;
+         } else {
+            AliWarning("Cannot get TPC chi^2 for non-track object");
+            fComputedValue = 0.0;
+            return kFALSE;
+         }
       default:
          AliError(Form("[%s] Invalid value type for this computation", GetName()));
          return kFALSE;
index 439dcee..f5279fa 100644 (file)
@@ -33,6 +33,8 @@ public:
       kNTPCclusters,  // n TPC clusters
       kITSchi2,    // ITS chi^2
       kTPCchi2,    // TPC chi^2
+      kDCAXY,      // DCA xy
+      kDCAZ,       // DCA z
       kTypes
    };
 
index 209a1c4..623b1a2 100644 (file)
@@ -494,6 +494,25 @@ void AddMonitorOutput(TObjArray *mon=0,TString opt="",AliRsnLoopDaughter *lm=0)
    if (mon) mon->Add(outMonitorTPCchi2);
    if (lm) lm->AddOutput(outMonitorTPCchi2);
 
+   // DCAXY
+   AliRsnValueDaughter *axisDCAXY = new AliRsnValueDaughter("XY", AliRsnValueDaughter::kDCAXY);
+   axisDCAXY->SetBins(200,-1,1);
+
+   AliRsnListOutput *outMonitorDCAXY = new AliRsnListOutput("DCA", AliRsnListOutput::kHistoDefault);
+   outMonitorDCAXY->AddValue(axisDCAXY);
+   // add outputs to loop
+   if (mon) mon->Add(outMonitorDCAXY);
+   if (lm) lm->AddOutput(outMonitorDCAXY);
+
+   // DCAZ
+   AliRsnValueDaughter *axisDCAZ = new AliRsnValueDaughter("Z", AliRsnValueDaughter::kDCAZ);
+   axisDCAZ->SetBins(200,-1,1);
+
+   AliRsnListOutput *outMonitorDCAZ = new AliRsnListOutput("DCA", AliRsnListOutput::kHistoDefault);
+   outMonitorDCAZ->AddValue(axisDCAZ);
+   // add outputs to loop
+   if (mon) mon->Add(outMonitorDCAZ);
+   if (lm) lm->AddOutput(outMonitorDCAZ);
 
    AliRsnListOutput *outMonitorPTvsMult = new AliRsnListOutput("PTvsMult",AliRsnListOutput::kHistoDefault);
    AliRsnValueDaughter *vd1 = new AliRsnValueDaughter("pt",AliRsnValueDaughter::kPt);