PWGPP-3, ATO-19 AliAnalysisTaskFilteredTree.{h,cxx} - Set downscaling factor to limit...
authormivanov <marian.ivanov@cern.ch>
Wed, 11 Jun 2014 10:23:22 +0000 (12:23 +0200)
committermivanov <marian.ivanov@cern.ch>
Wed, 11 Jun 2014 10:23:22 +0000 (12:23 +0200)
void SetFriendDownscaling(Double_t fact)

PWGPP/AliAnalysisTaskFilteredTree.cxx
PWGPP/AliAnalysisTaskFilteredTree.h

index 5141961..b2b22da 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "iostream"
 #include "TSystem.h"
-
 #include <TPDGCode.h>
 #include <TDatabasePDG.h>
 
@@ -91,6 +90,7 @@ ClassImp(AliAnalysisTaskFilteredTree)
   , fCentralityEstimator(0)
   , fLowPtTrackDownscaligF(0)
   , fLowPtV0DownscaligF(0)
+  , fFriendDownscaling(-3.)   
   , fProcessAll(kFALSE)
   , fProcessCosmics(kFALSE)
   , fProcessITSTPCmatchOut(kFALSE)  // swittch to process ITS/TPC standalone tracks
@@ -502,6 +502,7 @@ void AliAnalysisTaskFilteredTree::ProcessCosmics(AliESDEvent *const event, AliES
       //Bool_t newFriendTrack1=kFALSE;
       //if (!friendTrack1) {friendTrack1=new AliESDfriendTrack(); newFriendTrack1=kTRUE;}
       if (!friendTrack1) {friendTrack1=fDummyFriendTrack;}
+      
 
       if(!fFillTree) return;
       if(!fTreeSRedirector) return;
@@ -1409,7 +1410,26 @@ void AliAnalysisTaskFilteredTree::ProcessAll(AliESDEvent *const esdEvent, AliMCE
 
         //assign the dummy objects if needed
         if (!track) {track=fDummyTrack;}
-        if (!friendTrack) {friendTrack=fDummyFriendTrack;}
+       AliESDfriendTrack *friendTrackStore=friendTrack;    // store friend track for later processing
+       if (fFriendDownscaling>=1){  // downscaling number of friend tracks
+         friendTrackStore = (gRandom->Rndm()<1./fFriendDownscaling)? friendTrack:0;
+       }
+       if (fFriendDownscaling<=0){
+         if (((*fTreeSRedirector)<<"highPt").GetTree()){
+           TTree * tree = ((*fTreeSRedirector)<<"highPt").GetTree();
+           if (tree){
+             Double_t sizeAll=tree->GetZipBytes();
+             TBranch * br= tree->GetBranch("friendTrack.fPoints");
+             Double_t sizeFriend=(br!=NULL)?br->GetZipBytes():0;
+             br= tree->GetBranch("friendTrack.fcalibContainers");
+             if (br) sizeFriend+=br->GetZipBytes();
+             if (sizeFriend*TMath::Abs(fFriendDownscaling)>sizeAll) friendTrackStore=0;
+           }
+         }
+       }
+
+
+       //        if (!friendTrackStore && fFriendDownscaling<=1) {friendTrack=fDummyFriendTrack;}
         if (!vtxESD) {vtxESD=&dummyvtxESD;}
         if (mcEvent)
         {
@@ -1474,7 +1494,7 @@ void AliAnalysisTaskFilteredTree::ProcessAll(AliESDEvent *const esdEvent, AliMCE
           //{
           //  printf("no friend track\n");
           //}
-
+         
 
           (*fTreeSRedirector)<<"highPt"<<
             "gid="<<gid<<
@@ -1501,7 +1521,8 @@ void AliAnalysisTaskFilteredTree::ProcessAll(AliESDEvent *const esdEvent, AliMCE
             "ntracksITS="<<ntracksITS<<               // total number of the ITS tracks which were refitted
             //
             "esdTrack.="<<track<<                  // esdTrack as used in the physical analysis
-            "friendTrack.="<<friendTrack<<      // esdFriendTrack associated to the esdTrack
+           //            "friendTrack.="<<friendTrack<<      // esdFriendTrack associated to the esdTrack
+            "friendTrack.="<<friendTrackStore<<      // esdFriendTrack associated to the esdTrack
             "extTPCInnerC.="<<tpcInnerC<<          // ??? 
             "extInnerParamC.="<<trackInnerC<<      // ???
             "extInnerParam.="<<trackInnerC2<<      // ???
@@ -2921,25 +2942,41 @@ void AliAnalysisTaskFilteredTree::ProcessITSTPCmatchOut(AliESDEvent *const esdEv
   }
 }
 
-//void AliAnalysisTaskFilteredTree::ProcessTrackMatch(AliESDEvent *const esdEvent, AliESDfriend *const esdFriend){
+void AliAnalysisTaskFilteredTree::ProcessTrackMatch(AliESDEvent *const /*esdEvent*/, AliESDfriend *const /*esdFriend*/){
 /*
+    Use TPC standalone, ITS standalone and combined tracks to categorize/resp. recover track information.
+
+    Track categories:
+       -TPC+ITS
+       -TPC only 
+       -ITS only
+    Topology categories:
+       -Nice isolated tracks with full information 
+       -Overlapped tracks - Refit and sign them
+       -Multiple found (check overlap factor) - Merge and sign
+       -Charge particle (kink) decays - Change of direction - Sign them) 
+    Info:
+       -Array  of indexes of closest tracks in each individual category
+       -Chi2  distance to the closest tracks at reference radius of TPCin
+       -Overlap factors  - fraction of shared clusters or missing  region
+       -Chi2 distance at DCA
+    Information matrix:   
+       -matrix closest tracks from each categories
+       -characterization - chi2, index,chi2,  overlap ratio
+    
+    Decissions:
+       0.) Kink decay or catastophic multiple scaterring 
+           (combining all track categories)
+              - small chi2 at the DCA
+              - significantly large deflection angle
+              - Combinatorial algorithm - to decrease CPU time restriction of investigation to tracks with small DCA at  refernce radius
 
-Track categories:
-TPC+ITS
-TPC only 
-ITS only
-
-Options:
--OK
--Multiple found (check overlap factor)
--Kink decays - change of direction
-
-To make          - matrix closest tracks from each categories
-Characterization - chi2, index, overlap ratio
+       1.) if (TPConly && !(TPC+ITS) && ITSonly match ) {
+             if (!kink) TPCOnly.addoptITS
+             if (kink) TPConly sign
+           }
 
-New features:
-1.) if (TPConly && !(TPC+ITS) && ITSonly match ) TPCOnly.addoptITS
-2.) if (ITSonly && !(TPC+ITS)) (TPC+ITS).createConbined
-3.) Overlap tracks - doUnfold
+       2.) Overlap tracks - Refit with doUnfold
 
 */
+}
index 946ff62..44036f2 100644 (file)
@@ -64,6 +64,7 @@ class AliAnalysisTaskFilteredTree : public AliAnalysisTaskSE {
   void ProcessCosmics(AliESDEvent *const esdEvent=0, AliESDfriend* esdFriend=0); 
 
   void ProcessITSTPCmatchOut(AliESDEvent *const esdEvent=0,  AliESDfriend *const esdFriend=0);
+  void ProcessTrackMatch(AliESDEvent *const esdEvent=0,  AliESDfriend *const esdFriend=0);
 
   void SetEventCuts(AliFilteredTreeEventCuts* const cuts)              { fFilteredTreeEventCuts = cuts; }
   void SetAcceptanceCuts(AliFilteredTreeAcceptanceCuts* const cuts)    { fFilteredTreeAcceptanceCuts = cuts; }
@@ -97,6 +98,7 @@ class AliAnalysisTaskFilteredTree : public AliAnalysisTaskSE {
 
   void SetLowPtTrackDownscaligF(Double_t fact) { fLowPtTrackDownscaligF = fact; }
   void SetLowPtV0DownscaligF(Double_t fact)    { fLowPtV0DownscaligF = fact; }
+  void SetFriendDownscaling(Double_t fact)    { fFriendDownscaling = fact; }
   
   void   SetProcessCosmics(Bool_t flag) { fProcessCosmics = flag; }
   Bool_t GetProcessCosmics() { return fProcessCosmics; }
@@ -138,7 +140,8 @@ class AliAnalysisTaskFilteredTree : public AliAnalysisTaskSE {
   TString fCentralityEstimator;     // use centrality can be "VOM" (default), "FMD", "TRK", "TKL", "CL0", "CL1", "V0MvsFMD", "TKLvsV0M", "ZEMvsZDC"
 
   Double_t fLowPtTrackDownscaligF; // low pT track downscaling factor
-  Double_t fLowPtV0DownscaligF; // low pT V0 downscaling factor
+  Double_t fLowPtV0DownscaligF;    // low pT V0 downscaling factor
+  Double_t fFriendDownscaling;     // friend info downscaling )absolute value used), Modes>=1 downscaling in respect to the amount of tracks, Mode<=-1 (downscaling in respect to the data volume)
   Double_t fProcessAll; // Calculate all track properties including MC
   
   Bool_t fProcessCosmics; // look for cosmic pairs from random trigger