ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/SuperCluster.h
(Generate patch)

Comparing UserCode/MitAna/DataTree/interface/SuperCluster.h (file contents):
Revision 1.6 by bendavid, Fri Nov 14 14:46:35 2008 UTC vs.
Revision 1.17 by sixie, Fri Mar 26 15:09:11 2010 UTC

# Line 3 | Line 3
3   //
4   // SuperCluster
5   //
6 < // Details to be worked out...
6 > // This class holds the super cluster information.
7   //
8   // Authors: S.Xie
9   //--------------------------------------------------------------------------------------------------
# Line 12 | Line 12
12   #define MITANA_DATATREE_SUPERCLUSTER_H
13  
14   #include <TMath.h>
15 + #include "MitCommon/DataFormats/interface/Vect3C.h"
16   #include "MitAna/DataTree/interface/DataObject.h"
17   #include "MitAna/DataTree/interface/BasicCluster.h"
18   #include "MitAna/DataCont/interface/RefArray.h"
19 + #include "MitAna/DataCont/interface/Ref.h"
20  
21   namespace mithep
22   {
23    class SuperCluster : public DataObject
24    {
25      public:
26 <      SuperCluster() : fEnergy(0.0), fPoint(0,0,0) , fRawEnergy(-1.0) {}    
27 <      ~SuperCluster() {}
26 >      SuperCluster() : fEnergy(0), fEtaWidth(0), fPreshowerEnergy(0),
27 >                       fPhiWidth(0), fRawEnergy(0) {}    
28  
29 <      const BasicCluster  *Cluster(UInt_t i)       const { return fClusters.At(i); }
30 <      UInt_t               ClusterSize()           const { return fClusters.GetEntries(); }
31 <      Double_t             Energy()                const { return fEnergy; }      
32 <      Double_t             Eta()                   const { return fPoint.Eta(); }
33 <      Double_t             EtaWidth()              const { return fEtaWidth; }
34 <      Double_t             Phi()                   const { return fPoint.Phi(); }
35 <      Double_t             PhiWidth()              const { return fPhiWidth; }
36 <      Double_t             PreshowerEnergy()       const { return fPreshowerEnergy; }
37 <      Double_t             RawEnergy()             const { return fRawEnergy; }      
38 <      const BasicCluster  *Seed()                  const;      
39 <      Double_t             X()                     const { return fPoint.X(); }
40 <      Double_t             Y()                     const { return fPoint.Y(); }
41 <      Double_t             Z()                     const { return fPoint.Z(); }
42 <      void                 Print(Option_t *opt="") const;
43 <
44 <      void                 AddCluster( BasicCluster *Cluster)           { fClusters.Add(Cluster); }
45 <      void                 SetEnergy(Double_t Energy)                   { fEnergy = Energy;       }
46 <      void                 SetEtaWidth(Double_t EtaWidth)               { fEtaWidth = EtaWidth;   }
47 <      void                 SetPhiWidth(Double_t PhiWidth)               { fPhiWidth = PhiWidth;   }
48 <      void                 SetPreshowerEnergy(Double_t PreshowerEnergy) { fPreshowerEnergy
49 <                                                                            = PreshowerEnergy;    }
50 <      void                 SetRawEnergy(Double_t RawEnergy)             { fRawEnergy = RawEnergy; }
51 <      void                 SetSeed( BasicCluster* SeedRef)              { fSeedRef = SeedRef;     }
52 <      void                 SetXYZ(Double_t x, Double_t y, Double_t z)   { fPoint.SetXYZ(x,y,z);   }
29 >      void                   AddCluster(const BasicCluster *c)          { fClusters.Add(c);        }
30 >      const BasicCluster    *Cluster(UInt_t i)       const { return fClusters.At(i);               }
31 >      UInt_t                 ClusterSize()           const { return fClusters.Entries();           }
32 >      Int_t                  Compare(const TObject *o) const;  
33 >      Double_t               Energy()                const { return fEnergy;                       }
34 >      Double_t               Et()                    const;
35 >      Double_t               Eta()                   const { return fPoint.Eta();                  }
36 >      Double_t               EtaWidth()              const { return fEtaWidth;                     }
37 >      Double_t               HcalDepth1Energy()      const { return fHcalDepth1Energy;             }
38 >      Double_t               HcalDepth2Energy()      const { return fHcalDepth2Energy;             }
39 >      Double_t               HadDepth1OverEm()       const { return fHcalDepth1Energy/fEnergy;     }
40 >      Double_t               HadDepth2OverEm()       const { return fHcalDepth2Energy/fEnergy;     }
41 >      Double_t               HadOverEm()             const { return (fHcalDepth1Energy+
42 >                                                                     fHcalDepth2Energy)/fEnergy;   }
43 >      Bool_t                 IsSortable()            const { return kTRUE;                         }
44 >      EObjType               ObjType()               const { return kSuperCluster;                 }
45 >      Double_t               Phi()                   const { return fPoint.Phi();                  }
46 >      Double_t               PhiWidth()              const { return fPhiWidth;                     }
47 >      ThreeVectorC           Point()                 const { return fPoint.V();                    }
48 >      void                   Print(Option_t *opt="") const;
49 >      Double_t               PreshowerEnergy()       const { return fPreshowerEnergy;              }
50 >      Double_t               RawEnergy()             const { return fRawEnergy;                    }
51 >      Double_t               Rho()                   const { return fPoint.Rho();                  }
52 >      const BasicCluster    *Seed()                  const { return fSeedRef.Obj();                }
53 >      void                   SetEnergy(Double_t energy)                 { fEnergy = energy;        }
54 >      void                   SetEtaWidth(Double_t etaWidth)             { fEtaWidth = etaWidth;    }
55 >      void                   SetPhiWidth(Double_t phiWidth)             { fPhiWidth = phiWidth;    }
56 >      void                   SetPreshowerEnergy(Double_t e)             { fPreshowerEnergy = e;    }
57 >      void                   SetRawEnergy(Double_t rawEnergy)           { fRawEnergy = rawEnergy;  }
58 >      void                   SetHcalDepth1Energy(Double_t x)            { fHcalDepth1Energy = x;   }
59 >      void                   SetHcalDepth2Energy(Double_t x)            { fHcalDepth2Energy = x;   }
60 >      void                   SetSeed(const BasicCluster *s)             { fSeedRef = s;            }
61 >      void                   SetXYZ(Double_t x, Double_t y, Double_t z) { fPoint.SetXYZ(x,y,z);    }
62        
63      protected:
64 <      
65 <      Double32_t                fEnergy;          //Supercluster energy    
66 <      Double32_t                fEtaWidth;        //Width in Phi
67 <      ThreeVector32             fPoint;           //Centroid Position
68 <      Double32_t                fPreshowerEnergy; //Energy in the preshower
69 <      Double32_t                fPhiWidth;        //Width in Phi
70 <      Double32_t                fRawEnergy;       //Supercluster raw energy
71 <      RefArray<BasicCluster,1024> fClusters;        //BasicClusters in this SuperCluster
72 <      TRef                      fSeedRef;         //the seed cluster
64 >      Vect3C                  fPoint;               //centroid Position
65 >      Double32_t              fEnergy;              //[0,0,14]super cluster energy    
66 >      Double32_t              fEtaWidth;            //[0,0,14]width in Phi
67 >      Double32_t              fPreshowerEnergy;     //[0,0,14]energy in the preshower
68 >      Double32_t              fPhiWidth;            //[0,0,14]width in Phi
69 >      Double32_t              fRawEnergy;           //[0,0,14]super cluster raw energy
70 >      Double32_t              fHcalDepth1Energy;    //[0,0,14] hcal depth1 over ECAL energy
71 >      Double32_t              fHcalDepth2Energy;    //[0,0,14] hcal depth2 over ECAL energy
72 >      RefArray<BasicCluster>  fClusters;            //assigned basic clusters
73 >      Ref<BasicCluster>       fSeedRef;             //seed cluster
74  
75 <    ClassDef(SuperCluster, 1) // Generic particle class
75 >    ClassDef(SuperCluster, 2) // Super cluster class
76    };
77   }
78  
79   //--------------------------------------------------------------------------------------------------
80 < inline const mithep::BasicCluster *mithep::SuperCluster::Seed() const
81 < {
82 <  // Return tracker track.
80 > inline Double_t mithep::SuperCluster::Et() const
81 > {
82 >  // Return transverse energy.
83 >
84 >  return fEnergy*fPoint.Rho()/fPoint.V().R();
85 > }
86  
87 <  return static_cast<const BasicCluster*>(fSeedRef.GetObject());
87 > //--------------------------------------------------------------------------------------------------
88 > inline Int_t mithep::SuperCluster::Compare(const TObject *o) const
89 > {
90 >  // Default compare function for sorting according to transverse momentum.
91 >  // Returns -1 if this object is smaller than given object, 0 if objects are
92 >  // equal and 1 if this is larger than given object.
93 >
94 >  const mithep::SuperCluster *s = dynamic_cast<const mithep::SuperCluster *>(o);
95 >  if (!s)
96 >    return 1;
97 >
98 >  Double_t mye = Energy();
99 >  Double_t e   = s->Energy();
100 >  if (mye>e)
101 >    return -1;
102 >  else if (e>mye)
103 >    return +1;
104 >  return 0;
105   }
106   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines