variable type change (Emilia)
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Aug 2013 12:01:46 +0000 (12:01 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Aug 2013 12:01:46 +0000 (12:01 +0000)
PWGCF/Correlations/DPhi/AliAnalysisTaskMinijet.cxx
PWGCF/Correlations/DPhi/AliAnalysisTaskMinijet.h

index 44f7562..e67660e 100644 (file)
@@ -539,9 +539,9 @@ void AliAnalysisTaskMinijet::UserExec(Option_t *)
     
     
     //number of accepted tracks and tracklets
-    Int_t ntracks = 0;  //return value for reading functions for ESD and AOD
+    Double_t ntracks = 0;  //return value for reading functions for ESD and AOD
     //Int_t ntracksRemove = 0;  //return value for reading functions for ESD and AOD
-    vector<Int_t> nTracksTracklets; // [0]=nAccepted,1=ntracklets,2=nall(also neutral in case of mc,
+    vector<Double_t> nTracksTracklets; // [0]=nAccepted,1=ntracklets,2=nall(also neutral in case of mc,
     //for real nall=ncharged)
     
     if(!fAODEvent && !fESDEvent)return;
@@ -644,7 +644,7 @@ void AliAnalysisTaskMinijet::UserExec(Option_t *)
                 else AliInfo("Fatal Error");
                 
                 if (fCentralityMethod.Length() > 0)
-                    ntracks = TMath::Nint(centrality);
+                    ntracks = centrality;
                 
                 // analyse
                 if(pt.size()){ //(internally ntracks=fNRecAccept)
@@ -661,11 +661,11 @@ void AliAnalysisTaskMinijet::UserExec(Option_t *)
                     else AliInfo("Fatal Error");
                     
                     if (fCentralityMethod.Length() > 0)
-                        ntracks = TMath::Nint(centrality);
+                        ntracks = centrality;
                     
                     // analyse
                     if(pt.size()){ //(internally ntracks=fNRecAccept)
-                        Analyse(pt, eta, phi, charge, strangenessWeight, TMath::Nint(fNRecAcceptStrangeCorr), nTracksTracklets[1], nTracksTracklets[2], 7);//step 7 = TrigVtxRecNrecStrangeCorr
+                        Analyse(pt, eta, phi, charge, strangenessWeight, fNRecAcceptStrangeCorr, nTracksTracklets[1], nTracksTracklets[2], 7);//step 7 = TrigVtxRecNrecStrangeCorr
                     }
                 }
                 
@@ -695,11 +695,11 @@ void AliAnalysisTaskMinijet::UserExec(Option_t *)
                         else AliInfo("Fatal Error");
                         
                         if (fCentralityMethod.Length() > 0)
-                            ntracks = TMath::Nint(centrality);
+                            ntracks = centrality;
                         
                         //analyse
                         if(pt.size()){//(internally ntracks=fNRecAccept)
-                            Analyse(pt, eta, phi, charge, strangenessWeight, TMath::Nint(fNRecAcceptStrangeCorr), nTracksTracklets[1], nTracksTracklets[2], 6); //step 6 = TrigVtxRecMcPropNrecStrangeCorr
+                            Analyse(pt, eta, phi, charge, strangenessWeight, fNRecAcceptStrangeCorr, nTracksTracklets[1], nTracksTracklets[2], 6); //step 6 = TrigVtxRecMcPropNrecStrangeCorr
                         }
                     }
                     // step 3 = TrigVtxMcNrec
@@ -710,8 +710,8 @@ void AliAnalysisTaskMinijet::UserExec(Option_t *)
                     else AliInfo("Fatal Error");
                     
                     if (fCentralityMethod.Length() > 0){
-                        fNRecAccept = TMath::Nint(centrality);
-                        fNMcPrimAccept = TMath::Nint(centrality);
+                        fNRecAccept = centrality;
+                        fNMcPrimAccept = centrality;
                     }
                     
                     // analyse
@@ -739,7 +739,7 @@ void AliAnalysisTaskMinijet::UserExec(Option_t *)
                 else AliInfo("Fatal Error");
                 
                 if (fCentralityMethod.Length() > 0)
-                    fNMcPrimAccept = TMath::Nint(centrality);
+                    fNMcPrimAccept = centrality;
                 
                 
                 // analyse
@@ -764,7 +764,7 @@ void AliAnalysisTaskMinijet::UserExec(Option_t *)
                 else AliInfo("Fatal Error");
                 
                 if (fCentralityMethod.Length() > 0)
-                    fNMcPrimAccept = TMath::Nint(centrality);
+                    fNMcPrimAccept = centrality;
                 
                 //analyse
                 if(pt.size()){
@@ -780,7 +780,7 @@ void AliAnalysisTaskMinijet::UserExec(Option_t *)
         else if (fMode==1) ntracks  = ReadEventAODMC(pt, eta, phi, charge, strangenessWeight, nTracksTracklets, 0);
         
         if (fCentralityMethod.Length() > 0)
-            fNMcPrimAccept = TMath::Nint(centrality);
+            fNMcPrimAccept = centrality;
         
         // analyse
         if(pt.size()){
@@ -791,10 +791,10 @@ void AliAnalysisTaskMinijet::UserExec(Option_t *)
 
 
 //________________________________________________________________________
-Int_t AliAnalysisTaskMinijet::ReadEventESD( vector<Float_t> &ptArray,  vector<Float_t> &etaArray,
+Double_t AliAnalysisTaskMinijet::ReadEventESD( vector<Float_t> &ptArray,  vector<Float_t> &etaArray,
                                            vector<Float_t> &phiArray, vector<Short_t> &chargeArray,
                                            vector<Float_t> &strangeArray,
-                                           vector<Int_t>   &nTracksTracklets, const Int_t step)
+                                           vector<Double_t>   &nTracksTracklets, const Int_t step)
 {
     // gives back the number of esd tracks and pointer to arrays with track
     // properties (pt, eta, phi)
@@ -816,7 +816,7 @@ Int_t AliAnalysisTaskMinijet::ReadEventESD( vector<Float_t> &ptArray,  vector<Fl
     
     //first loop to check how many tracks are accepted
     //------------------
-    Int_t nAcceptedTracks=0;
+    Double_t nAcceptedTracks=0;
     //Float_t nAcceptedTracksStrange=0;
     for (Int_t iTracks = 0; iTracks < ntracks; iTracks++) {
         
@@ -898,10 +898,10 @@ Int_t AliAnalysisTaskMinijet::ReadEventESD( vector<Float_t> &ptArray,  vector<Fl
 }
 
 //________________________________________________________________________
-Int_t AliAnalysisTaskMinijet::ReadEventESDRecMcProp( vector<Float_t> &ptArray,  vector<Float_t> &etaArray,
+Double_t AliAnalysisTaskMinijet::ReadEventESDRecMcProp( vector<Float_t> &ptArray,  vector<Float_t> &etaArray,
                                                     vector<Float_t> &phiArray, vector<Short_t> &chargeArray,
                                                     vector<Float_t> &strangeArray,
-                                                    vector<Int_t> &nTracksTracklets, const Int_t step)
+                                                    vector<Double_t> &nTracksTracklets, const Int_t step)
 {
     // gives back the number of esd tracks and pointer to arrays with track
     // properties (pt, eta, phi) of mc particles if available
@@ -932,7 +932,7 @@ Int_t AliAnalysisTaskMinijet::ReadEventESDRecMcProp( vector<Float_t> &ptArray,
     fVertexZ[step]->Fill(vtxSPD->GetZ());
     
     //track loop
-    Int_t nAcceptedTracks=0;
+    Double_t nAcceptedTracks=0;
     for (Int_t iTracks = 0; iTracks < ntracks; iTracks++) {
         
         AliVParticle *vtrack = fESDEvent->GetTrack(iTracks);
@@ -1031,10 +1031,10 @@ Int_t AliAnalysisTaskMinijet::ReadEventESDRecMcProp( vector<Float_t> &ptArray,
 
 
 //________________________________________________________________________
-Int_t AliAnalysisTaskMinijet::ReadEventESDMC(vector<Float_t> &ptArray,  vector<Float_t> &etaArray,
+Double_t AliAnalysisTaskMinijet::ReadEventESDMC(vector<Float_t> &ptArray,  vector<Float_t> &etaArray,
                                              vector<Float_t> &phiArray, vector<Short_t> &chargeArray,
                                              vector<Float_t> &strangeArray,
-                                             vector<Int_t> &nTracksTracklets, const Int_t step)
+                                             vector<Double_t> &nTracksTracklets, const Int_t step)
 {
     // gives back the number of charged prim MC particle and pointer to arrays
     // with particle properties (pt, eta, phi)
@@ -1075,10 +1075,10 @@ Int_t AliAnalysisTaskMinijet::ReadEventESDMC(vector<Float_t> &ptArray,  vector<F
     
     //----------------------------------
     //first track loop to check how many chared primary tracks are available
-    Int_t nChargedPrimaries=0;
-    Int_t nAllPrimaries=0;
+    Double_t nChargedPrimaries=0;
+    Double_t nAllPrimaries=0;
     
-    Int_t nPseudoTracklets=0;
+    Double_t nPseudoTracklets=0;
     for (Int_t iTracks = 0; iTracks < ntracks; iTracks++) {
         AliMCParticle *track = dynamic_cast<AliMCParticle*>(mcEvent->GetTrack(iTracks));
         if (!track) {
@@ -1113,8 +1113,8 @@ Int_t AliAnalysisTaskMinijet::ReadEventESDMC(vector<Float_t> &ptArray,  vector<F
     //----------------------------------
     
     if(fDebug>2){
-        Printf("All in acceptance=%d",nAllPrimaries);
-        Printf("Charged in acceptance =%d",nChargedPrimaries);
+        Printf("All in acceptance=%f",nAllPrimaries);
+        Printf("Charged in acceptance =%f",nChargedPrimaries);
     }
     
     fChargedPi0->Fill(nAllPrimaries,nChargedPrimaries);
@@ -1187,10 +1187,10 @@ Int_t AliAnalysisTaskMinijet::ReadEventESDMC(vector<Float_t> &ptArray,  vector<F
 }
 
 //________________________________________________________________________
-Int_t AliAnalysisTaskMinijet::ReadEventAOD( vector<Float_t> &ptArray,  vector<Float_t> &etaArray,
+Double_t AliAnalysisTaskMinijet::ReadEventAOD( vector<Float_t> &ptArray,  vector<Float_t> &etaArray,
                                            vector<Float_t> &phiArray,  vector<Short_t> &chargeArray,
                                            vector<Float_t> &strangeArray,
-                                           vector<Int_t> &nTracksTracklets, const Int_t step)
+                                           vector<Double_t> &nTracksTracklets, const Int_t step)
 {
     // gives back the number of AOD tracks and pointer to arrays with track
     // properties (pt, eta, phi)
@@ -1217,7 +1217,7 @@ Int_t AliAnalysisTaskMinijet::ReadEventAOD( vector<Float_t> &ptArray,  vector<Fl
     if(fDebug>1) Printf("AOD tracks: %d", ntracks);
     
     
-    Int_t nAcceptedTracks=0;
+    Double_t nAcceptedTracks=0;
     Float_t nAcceptedTracksStrange=0;
     for (Int_t iTracks = 0; iTracks < ntracks; iTracks++) {
         AliAODTrack *track = (AliAODTrack *)fAODEvent->GetTrack(iTracks);
@@ -1317,10 +1317,10 @@ Int_t AliAnalysisTaskMinijet::ReadEventAOD( vector<Float_t> &ptArray,  vector<Fl
 }   
 
 //________________________________________________________________________
-Int_t AliAnalysisTaskMinijet::ReadEventAODRecMcProp( vector<Float_t> &ptArray,  vector<Float_t> &etaArray,
+Double_t AliAnalysisTaskMinijet::ReadEventAODRecMcProp( vector<Float_t> &ptArray,  vector<Float_t> &etaArray,
                                                     vector<Float_t> &phiArray, vector<Short_t> &chargeArray,
                                                     vector<Float_t> &strangeArray,
-                                                    vector<Int_t> &nTracksTracklets, const Int_t step)
+                                                    vector<Double_t> &nTracksTracklets, const Int_t step)
 {
     // gives back the number of AOD tracks and pointer to arrays with track
     // properties (pt, eta, phi)
@@ -1351,7 +1351,7 @@ Int_t AliAnalysisTaskMinijet::ReadEventAODRecMcProp( vector<Float_t> &ptArray,
     Double_t vzAOD=vtx->GetZ();
     fVertexZ[step]->Fill(vzAOD);
     
-    Int_t nAcceptedTracks=0;
+    Double_t nAcceptedTracks=0;
     for (Int_t iTracks = 0; iTracks < ntracks; iTracks++) {
         AliAODTrack *track = (AliAODTrack *)fAODEvent->GetTrack(iTracks);
         
@@ -1449,10 +1449,10 @@ Int_t AliAnalysisTaskMinijet::ReadEventAODRecMcProp( vector<Float_t> &ptArray,
 
 
 //________________________________________________________________________
-Int_t AliAnalysisTaskMinijet::ReadEventAODMC( vector<Float_t> &ptArray,  vector<Float_t> &etaArray,
+Double_t AliAnalysisTaskMinijet::ReadEventAODMC( vector<Float_t> &ptArray,  vector<Float_t> &etaArray,
                                              vector<Float_t> &phiArray, vector<Short_t> &chargeArray,
                                              vector<Float_t> &strangeArray,
-                                             vector<Int_t> &nTracksTracklets, const Int_t step)
+                                             vector<Double_t> &nTracksTracklets, const Int_t step)
 {
     // gives back the number of AOD MC particles and pointer to arrays with particle
     // properties (pt, eta, phi)
@@ -1487,9 +1487,9 @@ Int_t AliAnalysisTaskMinijet::ReadEventAODMC( vector<Float_t> &ptArray,  vector<
     
     // Track loop: chek how many particles will be accepted
     //Float_t vzMC=0.;
-    Int_t nChargedPrim=0;
-    Int_t nAllPrim=0;
-    Int_t nPseudoTracklets=0;
+    Double_t nChargedPrim=0;
+    Double_t nAllPrim=0;
+    Double_t nPseudoTracklets=0;
     for (Int_t it = 0; it < ntracks; it++) {
         AliAODMCParticle *track = (AliAODMCParticle*)mcArray->At(it);
         if (!track) {
@@ -1587,7 +1587,7 @@ void AliAnalysisTaskMinijet::Analyse(const vector<Float_t> &pt,
                                      const vector<Float_t> &phi,
                                      const vector<Short_t> &charge,
                                      const vector<Float_t> &strangeWeight,
-                                     const Int_t ntracksCharged,
+                                     const Double_t ntracksCharged,
                                      const Int_t ntracklets,
                                      const Int_t nAll,
                                      const Int_t step)
@@ -1602,7 +1602,7 @@ void AliAnalysisTaskMinijet::Analyse(const vector<Float_t> &pt,
         Printf("Analysis Step=%d", step);
         if(fDebug>2){
             Printf("nAll=%d",nAll);
-            Printf("nCharged=%d",ntracksCharged);
+            Printf("nCharged=%f",ntracksCharged);
             for (Int_t i = 0; i < nAll; i++) {
                 Printf("pt[%d]=%f",i,pt[i]);
             }
index 6dadc1d..7fa97ab 100644 (file)
@@ -49,38 +49,38 @@ class AliAnalysisTaskMinijet : public AliAnalysisTaskSE {
     \r
  private:\r
 \r
-  Int_t ReadEventESD         (std::vector<Float_t> &pt,  std::vector<Float_t> &eta,\r
+  Double_t ReadEventESD         (std::vector<Float_t> &pt,  std::vector<Float_t> &eta,\r
                              std::vector<Float_t> &phi,  std::vector<Short_t> &charge,\r
                              std::vector<Float_t> &strangnessWeight,\r
-                             std::vector<Int_t> &nTracksTracklets, const Int_t step);\r
-  Int_t ReadEventESDRecMcProp(std::vector<Float_t> &pt,  std::vector<Float_t> &eta,\r
+                             std::vector<Double_t> &nTracksTracklets, const Int_t step);\r
+  Double_t ReadEventESDRecMcProp(std::vector<Float_t> &pt,  std::vector<Float_t> &eta,\r
                              std::vector<Float_t> &phi,  std::vector<Short_t> &charge,\r
                              std::vector<Float_t> &strangnessWeight,\r
-                             std::vector<Int_t> &nTracksTracklets, const Int_t step);\r
-  Int_t ReadEventESDMC       (std::vector<Float_t> &pt,  std::vector<Float_t> &eta,\r
+                             std::vector<Double_t> &nTracksTracklets, const Int_t step);\r
+  Double_t ReadEventESDMC       (std::vector<Float_t> &pt,  std::vector<Float_t> &eta,\r
                              std::vector<Float_t> &phi,  std::vector<Short_t> &charge,\r
                              std::vector<Float_t> &strangnessWeight,\r
-                             std::vector<Int_t> &nTracksTracklets, const Int_t step);\r
+                             std::vector<Double_t> &nTracksTracklets, const Int_t step);\r
   \r
-  Int_t ReadEventAOD         (std::vector<Float_t> &pt,  std::vector<Float_t> &eta,  \r
+  Double_t ReadEventAOD         (std::vector<Float_t> &pt,  std::vector<Float_t> &eta,\r
                              std::vector<Float_t> &phi,  std::vector<Short_t> &charge,\r
                              std::vector<Float_t> &strangnessWeight,\r
-                             std::vector<Int_t> &nTracksTracklets, const Int_t step);\r
-  Int_t ReadEventAODRecMcProp(std::vector<Float_t> &pt,  std::vector<Float_t> &eta,\r
+                             std::vector<Double_t> &nTracksTracklets, const Int_t step);\r
+  Double_t ReadEventAODRecMcProp(std::vector<Float_t> &pt,  std::vector<Float_t> &eta,\r
                              std::vector<Float_t> &phi,  std::vector<Short_t> &charge,\r
                              std::vector<Float_t> &strangnessWeight,\r
-                             std::vector<Int_t> &nTracksTracklets, const Int_t step);\r
-  Int_t ReadEventAODMC       (std::vector<Float_t> &pt,  std::vector<Float_t> &eta,  \r
+                             std::vector<Double_t> &nTracksTracklets, const Int_t step);\r
+  Double_t ReadEventAODMC       (std::vector<Float_t> &pt,  std::vector<Float_t> &eta,\r
                              std::vector<Float_t> &phi,  std::vector<Short_t> &charge,\r
                              std::vector<Float_t> &strangnessWeight,\r
-                             std::vector<Int_t> &nTracksTracklets, const Int_t step);\r
+                             std::vector<Double_t> &nTracksTracklets, const Int_t step);\r
   \r
   void  Analyse         (const std::vector<Float_t> &pt, \r
                         const std::vector<Float_t> &eta, \r
                         const std::vector<Float_t> &phi, \r
                         const std::vector<Short_t> &charge, \r
                         const std::vector<Float_t> &strangnessWeight,\r
-                        const Int_t ntacks, const Int_t ntacklets=0, \r
+                        const Double_t ntacks, const Int_t ntacklets=0,\r
                         const Int_t nAll=0, const Int_t step=0);\r
   \r
   Bool_t                 SelectParticlePlusCharged(const Short_t charge, const Int_t pdg, const Bool_t prim);\r
@@ -116,11 +116,11 @@ class AliAnalysisTaskMinijet : public AliAnalysisTaskSE {
 \r
   AliESDEvent *fESDEvent;                   //! esd event\r
   AliAODEvent *fAODEvent;                   //! aod event\r
-  Int_t        fNMcPrimAccept;              // global variable for mc multiplucity\r
-  Int_t        fNRecAccept;                 // global variable for rec multiplucity\r
+  Double_t        fNMcPrimAccept;              // global variable for mc multiplucity\r
+  Double_t        fNRecAccept;                 // global variable for rec multiplucity\r
   Float_t      fNRecAcceptStrangeCorr;                 // global variable for rec multiplucity\r
-  Int_t        fNMcPrimAcceptTracklet;      // global variable for mc multiplucity\r
-  Int_t        fNRecAcceptTracklet;         // global variable for rec multiplucity\r
+  Double_t        fNMcPrimAcceptTracklet;      // global variable for mc multiplucity\r
+  Double_t        fNRecAcceptTracklet;         // global variable for rec multiplucity\r
   Float_t      fVzEvent;                    // global variable for rec vertex position\r
   Double_t     fMeanPtRec;                  // global variable for rec mean pt\r
   Double_t     fLeadingPtRec;               // global variable for rec mean pt\r
@@ -193,7 +193,7 @@ class AliAnalysisTaskMinijet : public AliAnalysisTaskSE {
   AliAnalysisTaskMinijet(const AliAnalysisTaskMinijet&); // not implemented\r
   AliAnalysisTaskMinijet& operator=(const AliAnalysisTaskMinijet&); // not implemented\r
   \r
-  ClassDef(AliAnalysisTaskMinijet, 1); // example of analysis\r
+  ClassDef(AliAnalysisTaskMinijet, 2); // mini jet analysis with two particle correlations\r
 };\r
 \r
 #endif\r