Browse Source

Changed UEvent to meet the TClonesArray version of the DST.

Nikita Ermakov 5 years ago
parent
commit
d51d51f55f
2 changed files with 3 additions and 78 deletions
  1. 2 66
      UEvent.cxx
  2. 1 12
      UEvent.h

+ 2 - 66
UEvent.cxx

@@ -17,7 +17,6 @@ UEvent::UEvent() : TObject(), fEventNr(0), fB(0), fPhi(0),
                    fNes(0), fStepNr(0), fStepT(0), fComment("") {
   // Default constructor
   /* empty */
-  fParticles = new TClonesArray("UParticle", 100);
 }
 
 //_________________
@@ -36,7 +35,6 @@ UEvent::UEvent(const UEvent& right) : TObject() {
 UEvent::~UEvent() {
   // Destructor
   Clear();
-  delete fParticles;
 }
 
 //_________________
@@ -54,63 +52,12 @@ void UEvent::print(Option_t* option) {
             << "Comment                    :\n" << fComment << std::endl;
   TString opt = option;
   if(opt.Contains("all")) {
-    UParticle* particle;
-    for(Int_t iPa = 0; iPa < fNpa; iPa++) {
-      particle = (UParticle*) fParticles->At(iPa);
-      particle->print(option);
-    }
+    // TODO: particle info?
   }
   std::cout << "---------------------------------------------" << std::endl;
 }
 
 //_________________
-UParticle* UEvent::getParticle(Int_t index) const {
-  // Get pointer to the particle.
-  // index - index of the particle
-  if(index < 0) {
-    return nullptr;
-  }
-  if(index >= fNpa) {
-    return nullptr;
-  }
-  return ((UParticle*) fParticles->At(index));
-}
-
-//_________________
-void UEvent::addParticle(Int_t index, Int_t pdg, Int_t status,
-                  			 Int_t parent, Int_t parentDecay,
-                  			 Int_t mate, Int_t decay, Int_t child[2],
-                  			 Double_t px, Double_t py, Double_t pz, Double_t e,
-                  			 Double_t x, Double_t y, Double_t z, Double_t t,
-                  			 Double_t weight) {
-  // Add particle to the array
-  new ((*fParticles)[fNpa]) UParticle(index, pdg, status, parent,
-				      parentDecay, mate, decay, child,
-				      px, py, pz, e, x, y, z, t, weight);
-  fNpa += 1;
-}
-
-//_________________
-void UEvent::addParticle(Int_t index, Int_t pdg, Int_t status,
-                  			 Int_t parent, Int_t parentDecay,
-                  			 Int_t mate, Int_t decay, Int_t child[2],
-                  			 TLorentzVector mom, TLorentzVector pos,
-                  			 Double_t weight) {
-  // Add particle to the array
-  new ((*fParticles)[fNpa]) UParticle(index, pdg, status, parent,
-				      parentDecay, mate, decay, child,
-				      mom, pos, weight);
-  fNpa += 1;
-}
-
-//_________________
-void UEvent::addParticle(const UParticle& particle) {
-  // Add particle to the array
-  new ((*fParticles)[fNpa]) UParticle(particle);
-  fNpa += 1;
-}
-
-//_________________
 void UEvent::setParameters(const Int_t& eventNr, const Double_t& b,
                            const Double_t& phi, const Int_t& nes,
                   			   const Int_t& stepNr, const Double_t& stepT,
@@ -129,16 +76,5 @@ void UEvent::setParameters(const Int_t& eventNr, const Double_t& b,
 
 //_________________
 void UEvent::clear() {
-  // Remove the particles from the array and reset counter
-  fParticles->Clear();
-  fNpa = 0;
-}
-
-//_________________
-void UEvent::removeAt(Int_t i) {
-  // Remove one particle from the array.
-  // i - index of the particle.
-  // Array is automaticaly compressed afterwards, mind the indexing
-  fParticles->RemoveAt(i);
-  fParticles->Compress();
+  /* noop */
 }

+ 1 - 12
UEvent.h

@@ -88,15 +88,6 @@ class UEvent : public TObject {
   /// Set comment
   void setComment(const char* comment)   { fComment = comment; }
 
-  void addParticle(Int_t index, Int_t pdg, Int_t status, Int_t parent, Int_t parentDecay,
-		   Int_t mate, Int_t decay, Int_t child[2],
-		   Double_t px, Double_t py, Double_t pz, Double_t e,
-		   Double_t x, Double_t y, Double_t z, Double_t t,
-		   Double_t weight);
-  void addParticle(Int_t index, Int_t pdg, Int_t status, Int_t parent, Int_t parentDecay,
-		   Int_t mate, Int_t decay, Int_t child[2],
-		   TLorentzVector mom, TLorentzVector pos, Double_t weight);
-  void addParticle(const UParticle& particle);
   void clear();
   void removeAt(Int_t i);
 
@@ -117,10 +108,8 @@ class UEvent : public TObject {
   UShort_t      fNpa;
   /// Generator-specific information
   TString       fComment;
-  /// Array of particles
-  TClonesArray* fParticles;
 
-  ClassDef(UEvent, 4);
+  ClassDef(UEvent, 5);
 };
 
 #endif