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.12 by loizides, Wed Apr 8 10:24:33 2009 UTC vs.
Revision 1.22 by fabstoec, Fri Jul 15 17:23:50 2011 UTC

# Line 15 | Line 15
15   #include "MitCommon/DataFormats/interface/Vect3C.h"
16   #include "MitAna/DataTree/interface/DataObject.h"
17   #include "MitAna/DataTree/interface/BasicCluster.h"
18 + #include "MitAna/DataTree/interface/CaloTower.h"
19   #include "MitAna/DataCont/interface/RefArray.h"
20   #include "MitAna/DataCont/interface/Ref.h"
21  
# Line 26 | Line 27 | namespace mithep
27        SuperCluster() : fEnergy(0), fEtaWidth(0), fPreshowerEnergy(0),
28                         fPhiWidth(0), fRawEnergy(0) {}    
29  
30 <      void                    AddCluster(const BasicCluster *c)      { fClusters.Add(c);           }
31 <      const BasicCluster     *Cluster(UInt_t i)       const { return fClusters.At(i);              }
32 <      UInt_t                  ClusterSize()           const { return fClusters.Entries();          }
33 <      Double_t                Energy()                const { return fEnergy;                      }
34 <      Double_t                Eta()                   const { return fPoint.Eta();                 }
35 <      Double_t                EtaWidth()              const { return fEtaWidth;                    }
36 <      EObjType                ObjType()               const { return kSuperCluster;                }
37 <      Double_t                Phi()                   const { return fPoint.Phi();                 }
38 <      Double_t                PhiWidth()              const { return fPhiWidth;                    }
39 <      ThreeVectorC            Point()                 const { return fPoint.V();                   }
40 <      void                    Print(Option_t *opt="") const;
41 <      Double_t                PreshowerEnergy()       const { return fPreshowerEnergy;             }
42 <      Double_t                RawEnergy()             const { return fRawEnergy;                   }
43 <      Double_t                Rho()                   const { return fPoint.Rho();                 }
44 <      const BasicCluster     *Seed()                  const { return fSeedRef.Obj();               }
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 e)             { fPreshowerEnergy = e;   }
49 <      void                    SetRawEnergy(Double_t rawEnergy)           { fRawEnergy = rawEnergy; }
50 <      void                    SetSeed(const BasicCluster *s)             { fSeedRef = s;           }
51 <      void                    SetXYZ(Double_t x, Double_t y, Double_t z) { fPoint.SetXYZ(x,y,z);   }
30 >      void                   AddCluster(const BasicCluster *c)          { fClusters.Add(c);        }
31 >      void                   AddTower(const CaloTower *t)               { fCaloTowers.Add(t);      }
32 >      const BasicCluster    *Cluster(UInt_t i)       const { return fClusters.At(i);               }
33 >      UInt_t                 ClusterSize()           const { return fClusters.Entries();           }
34 >      Int_t                  Compare(const TObject *o) const;  
35 >      Double_t               Energy()                const { return fEnergy;                       }
36 >      Double_t               Et()                    const;
37 >      Double_t               Eta()                   const { return fPoint.Eta();                  }
38 >      Double_t               AbsEta()                const { return TMath::Abs(Eta());             }
39 >      Double_t               EtaWidth()              const { return fEtaWidth;                     }
40 >      Bool_t                 HasSeed()               const { return fSeedRef.IsValid();            }
41 >      Bool_t                 HasTower(const CaloTower *t) const { return fCaloTowers.HasObject(t); }
42 >      Double_t               HcalDepth1Energy()      const { return fHcalDepth1Energy;             }
43 >      Double_t               HcalDepth2Energy()      const { return fHcalDepth2Energy;             }
44 >      Double_t               HadDepth1OverEm()       const { return fHcalDepth1Energy/fEnergy;     }
45 >      Double_t               HadDepth2OverEm()       const { return fHcalDepth2Energy/fEnergy;     }
46 >      Double_t               HadOverEm()             const { return (fHcalDepth1Energy+
47 >                                                                     fHcalDepth2Energy)/fEnergy;   }
48 >      Bool_t                 IsSortable()            const { return kTRUE;                         }
49 >      EObjType               ObjType()               const { return kSuperCluster;                 }
50 >      UInt_t                 NTowers()               const { return fCaloTowers.Entries();         }
51 >      Double_t               Phi()                   const { return fPoint.Phi();                  }
52 >      Double_t               PhiWidth()              const { return fPhiWidth;                     }
53 >      ThreeVectorC           Point()                 const { return fPoint.V();                    }
54 >      void                   Print(Option_t *opt="") const;
55 >      Double_t               PreshowerEnergy()       const { return fPreshowerEnergy;              }
56 >      Double_t               RawEnergy()             const { return fRawEnergy;                    }
57 >      Double_t               Rho()                   const { return fPoint.Rho();                  }
58 >      Double_t               R9()                    const { return fSeedRef.Obj()->E3x3()/fRawEnergy; }
59 >      const BasicCluster    *Seed()                  const { return fSeedRef.Obj();                }
60 >      const CaloTower       *Tower(UInt_t i)         const { return fCaloTowers.At(i);             }
61 >      void                   SetEnergy(Double_t energy)                 { fEnergy = energy;        }
62 >      void                   SetEtaWidth(Double_t etaWidth)             { fEtaWidth = etaWidth;    }
63 >      void                   SetPhiWidth(Double_t phiWidth)             { fPhiWidth = phiWidth;    }
64 >      void                   SetPreshowerEnergy(Double_t e)             { fPreshowerEnergy = e;    }
65 >      void                   SetRawEnergy(Double_t rawEnergy)           { fRawEnergy = rawEnergy;  }
66 >      void                   SetHcalDepth1Energy(Double_t x)            { fHcalDepth1Energy = x;   }
67 >      void                   SetHcalDepth2Energy(Double_t x)            { fHcalDepth2Energy = x;   }
68 >      void                   SetSeed(const BasicCluster *s)             { fSeedRef = s;            }
69 >      void                   SetXYZ(Double_t x, Double_t y, Double_t z) { fPoint.SetXYZ(x,y,z);    }
70        
71      protected:
72 <      Vect3C                  fPoint;           //centroid Position
73 <      Double32_t              fEnergy;          //[0,0,14]super cluster energy    
74 <      Double32_t              fEtaWidth;        //[0,0,14]width in Phi
75 <      Double32_t              fPreshowerEnergy; //[0,0,14]energy in the preshower
76 <      Double32_t              fPhiWidth;        //[0,0,14]width in Phi
77 <      Double32_t              fRawEnergy;       //[0,0,14]super cluster raw energy
78 <      RefArray<BasicCluster>  fClusters;        //assigned basic clusters
79 <      Ref<BasicCluster>       fSeedRef;         //seed cluster
72 >      Vect3C                  fPoint;               //centroid Position
73 >      Double32_t              fEnergy;              //[0,0,14]super cluster energy    
74 >      Double32_t              fEtaWidth;            //[0,0,14]width in Phi
75 >      Double32_t              fPreshowerEnergy;     //[0,0,14]energy in the preshower
76 >      Double32_t              fPhiWidth;            //[0,0,14]width in Phi
77 >      Double32_t              fRawEnergy;           //[0,0,14]super cluster raw energy
78 >      Double32_t              fHcalDepth1Energy;    //[0,0,14] hcal depth1 over ECAL energy
79 >      Double32_t              fHcalDepth2Energy;    //[0,0,14] hcal depth2 over ECAL energy
80 >      RefArray<BasicCluster>  fClusters;            //assigned basic clusters
81 >      Ref<BasicCluster>       fSeedRef;             //seed cluster
82 >      RefArray<CaloTower>     fCaloTowers;          //calo towers (matched by detid)
83  
84 <    ClassDef(SuperCluster, 1) // Super cluster class
84 >    ClassDef(SuperCluster, 3) // Super cluster class
85    };
86   }
87 +
88 + //--------------------------------------------------------------------------------------------------
89 + inline Double_t mithep::SuperCluster::Et() const
90 + {
91 +  // Return transverse energy.
92 +
93 +  return fEnergy*fPoint.Rho()/fPoint.V().R();
94 + }
95 +
96 + //--------------------------------------------------------------------------------------------------
97 + inline Int_t mithep::SuperCluster::Compare(const TObject *o) const
98 + {
99 +  // Default compare function for sorting according to transverse momentum.
100 +  // Returns -1 if this object is smaller than given object, 0 if objects are
101 +  // equal and 1 if this is larger than given object.
102 +
103 +  const mithep::SuperCluster *s = dynamic_cast<const mithep::SuperCluster *>(o);
104 +  if (!s)
105 +    return 1;
106 +
107 +  Double_t mye = Energy();
108 +  Double_t e   = s->Energy();
109 +  if (mye>e)
110 +    return -1;
111 +  else if (e>mye)
112 +    return +1;
113 +  return 0;
114 + }
115   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines