Full overloading of ImportParticles
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 20 Nov 2005 16:57:24 +0000 (16:57 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 20 Nov 2005 16:57:24 +0000 (16:57 +0000)
THbtp/THBTprocessor.cxx
THbtp/THBTprocessor.h

index 5b90930..e87f0db 100644 (file)
@@ -445,6 +445,33 @@ Int_t THBTprocessor::ImportParticles(TClonesArray *particles, Option_t */*option
  }
 
 /*****************************************************************************************/
+TObjArray * THBTprocessor::ImportParticles(Option_t */*option*/)
+ {
+  //Copy particle data into TObjArray
+  fParticles->Clear();
+  Int_t nrpart = 0;
+  for (Int_t i=0; i < TRK_MAXLEN; i++) 
+   {
+   
+    
+      if (TRACK1.trk_E[i] == 0.) continue;
+    
+      Float_t px   = TRACK1.trk_px[i];
+      Float_t py   = TRACK1.trk_py[i];
+      Float_t pz   = TRACK1.trk_pz[i];
+//    Float_t pE   = TRACK.trk_E[i];
+      Float_t mass = PARTICLE.part_mass[TRACK1.trk_ge_pid[i]];
+    
+      TParticle * p =new TParticle(0,0,0,0,0,0,px,py,pz,
+                                  TMath::Sqrt(mass*mass+px*px+py*py+pz*pz),
+                                  0,0,0,0);
+      fParticles->Add(p);
+   }
+  return fParticles;        
+ }
+
+/*****************************************************************************************/
 
 void THBTprocessor::PrintEvent() const
  {
index 6767d92..d2ea9cc 100644 (file)
@@ -41,6 +41,7 @@ class THBTprocessor: public TGenerator
       virtual void  GenerateEvent() const;
       virtual void  PrintEvent() const;
       virtual Int_t ImportParticles(TClonesArray *particles, Option_t *option="");
+      virtual TObjArray      *ImportParticles(Option_t *option="");
 
       //Set/Gets
       //comprehensive description off all these methods