create static objects without new + add syswatch log to the standalone filtering...
authormkrzewic <mikolaj.krzewicki@cern.ch>
Mon, 7 Apr 2014 11:40:34 +0000 (13:40 +0200)
committermkrzewic <mikolaj.krzewicki@cern.ch>
Mon, 7 Apr 2014 11:42:05 +0000 (13:42 +0200)
PWGPP/AliAnalysisTaskFilteredTree.cxx
PWGPP/macros/runFilteringTask.C

index 3e4cce3..3ff8e46 100644 (file)
@@ -1389,44 +1389,43 @@ void AliAnalysisTaskFilteredTree::ProcessAll(AliESDEvent *const esdEvent, AliMCE
         }
 
         //init dummy objects
-        static AliESDVertex* dummyvtxESD=NULL;
-        if (!dummyvtxESD) 
-        {
-          dummyvtxESD=new AliESDVertex();
-          //dummyvtxESD->SetNContributors(1);
-          //UShort_t pindices[1]; pindices[0]=0;
-          //dummyvtxESD->SetIndices(1,pindices);
-          //dummyvtxESD->SetNContributors(0);
-        }
-        static AliESDtrack* dummytrack=NULL;
-        if (!dummytrack) dummytrack=new AliESDtrack();
-        static AliExternalTrackParam* dummyexternaltrackparam=NULL;
-        if (!dummyexternaltrackparam) dummyexternaltrackparam=new AliExternalTrackParam();
-        static AliTrackReference* dummytrackreference=NULL;
-        if (!dummytrackreference) dummytrackreference=new AliTrackReference();
-        static TParticle* dummyparticle=NULL;
-        if (!dummyparticle) dummyparticle=new TParticle();
+        static AliESDVertex dummyvtxESD;
+        //if (!dummyvtxESD) 
+        //{
+        //  dummyvtxESD=new AliESDVertex();
+        //  //dummyvtxESD->SetNContributors(1);
+        //  //UShort_t pindices[1]; pindices[0]=0;
+        //  //dummyvtxESD->SetIndices(1,pindices);
+        //  //dummyvtxESD->SetNContributors(0);
+        //}
+        static AliExternalTrackParam dummyexternaltrackparam;
+        //if (!dummyexternaltrackparam) dummyexternaltrackparam=new AliExternalTrackParam();
+        static AliTrackReference dummytrackreference;
+        //if (!dummytrackreference) dummytrackreference=new AliTrackReference();
+        static TParticle dummyparticle;
+        //if (!dummyparticle) dummyparticle=new TParticle();
 
         //assign the dummy objects if needed
-        if (!track) {track=dummytrack;}
+        if (!track) {track=fDummyTrack;}
         if (!friendTrack) {friendTrack=fDummyFriendTrack;}
+        if (!vtxESD) {vtxESD=&dummyvtxESD;}
         if (mcEvent)
         {
-          if (!refTPCIn) {refTPCIn=dummytrackreference;}
-          if (!refITS) {refITS=dummytrackreference;}
-          if (!particle) {particle=dummyparticle;}
-          if (!particleMother) {particleMother=dummyparticle;}
-          if (!particleTPC) {particleTPC=dummyparticle;}
-          if (!particleMotherTPC) {particleMotherTPC=dummyparticle;}
-          if (!particleITS) {particleITS=dummyparticle;}
-          if (!particleMotherITS) {particleMotherITS=dummyparticle;}
+          if (!refTPCIn) {refTPCIn=&dummytrackreference;}
+          if (!refITS) {refITS=&dummytrackreference;}
+          if (!particle) {particle=&dummyparticle;}
+          if (!particleMother) {particleMother=&dummyparticle;}
+          if (!particleTPC) {particleTPC=&dummyparticle;}
+          if (!particleMotherTPC) {particleMotherTPC=&dummyparticle;}
+          if (!particleITS) {particleITS=&dummyparticle;}
+          if (!particleMotherITS) {particleMotherITS=&dummyparticle;}
         }
         //the following are guaranteed to exist:
-        //if (!tpcInnerC) {tpcInnerC=dummyexternaltrackparam;}
-        //if (!trackInnerC) {trackInnerC=dummyexternaltrackparam;}
-        //if (!trackInnerC2) {trackInnerC2=dummyexternaltrackparam;}
-        //if (!outerITSc) {outerITSc=dummyexternaltrackparam;}
-        //if (!trackInnerC3) {trackInnerC3=dummyexternaltrackparam;}
+        //if (!tpcInnerC) {tpcInnerC=&dummyexternaltrackparam;}
+        //if (!trackInnerC) {trackInnerC=&dummyexternaltrackparam;}
+        //if (!trackInnerC2) {trackInnerC2=&dummyexternaltrackparam;}
+        //if (!outerITSc) {outerITSc=&dummyexternaltrackparam;}
+        //if (!trackInnerC3) {trackInnerC3=&dummyexternaltrackparam;}
         /////////////////////////
 
         //Double_t vtxX=vtxESD->GetX();
@@ -1512,7 +1511,7 @@ void AliAnalysisTaskFilteredTree::ProcessAll(AliESDEvent *const esdEvent, AliMCE
             "centralityF="<<centralityF;
           if (mcEvent)
           {
-            AliTrackReference refDummy;
+            static AliTrackReference refDummy;
             if (!refITS) refITS = &refDummy;
             if (!refTRD) refTRD = &refDummy;
             if (!refTOF) refTOF = &refDummy;
@@ -1559,7 +1558,7 @@ void AliAnalysisTaskFilteredTree::ProcessAll(AliESDEvent *const esdEvent, AliMCE
           AliInfo("writing tree highPt");
           (*fTreeSRedirector)<<"highPt"<<"\n";
         }
-        //AliSysInfo::AddStamp("a",iTrack,numberOfTracks,numberOfFriendTracks);
+        AliSysInfo::AddStamp("filteringTask",iTrack,numberOfTracks,numberOfFriendTracks,(friendTrack=fDummyFriendTrack)?0:1);
 
         delete tpcInnerC;
         delete trackInnerC;
index 7a371e1..8995b84 100755 (executable)
@@ -32,6 +32,7 @@ void runFilteringTask( const char* esdList,
     // Make the analysis manager
     AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
     mgr->SetDebugLevel(0);
+    mgr->SetNSysInfo(10);
 
     AliESDInputHandler* esdH = new AliESDInputHandler();
     esdH->SetReadFriends(1);