00001 #ifndef HSCParticle_H 00002 #define HSCParticle_H 00003 #include "DataFormats/Common/interface/AssociationVector.h" 00004 #include "DataFormats/Common/interface/AssociationMap.h" 00005 #include "DataFormats/MuonReco/interface/MuonFwd.h" 00006 #include "DataFormats/MuonReco/interface/Muon.h" 00007 #include "DataFormats/TrackReco/interface/Track.h" 00008 #include "DataFormats/TrackReco/interface/DeDxData.h" 00009 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" 00010 #include "DataFormats/GeometryVector/interface/GlobalPoint.h" 00011 #include <vector> 00012 00013 #include "DataFormats/MuonReco/interface/MuonTimeExtra.h" 00014 #include "AnalysisDataFormats/SUSYBSMObjects/interface/HSCPCaloInfo.h" 00015 00016 namespace susybsm { 00017 00019 namespace HSCParticleType{ 00020 enum Type {globalMuon, trackerMuon, matchedStandAloneMuon, standAloneMuon, innerTrack, unknown }; 00021 } 00022 00023 class RPCHit4D 00024 { 00025 public: 00026 int id; 00027 int bx; 00028 GlobalPoint gp; 00029 bool operator<(const RPCHit4D& other) const { 00030 return gp.mag() < other.gp.mag(); 00031 } 00032 }; 00033 00034 00035 class RPCBetaMeasurement 00036 { 00037 public: 00038 bool isCandidate; 00039 float beta; 00040 00041 RPCBetaMeasurement(){ 00042 isCandidate = false; 00043 beta = -9999; 00044 } 00045 }; 00046 00047 00048 class HSCParticle 00049 { 00050 public: 00051 // constructor 00052 HSCParticle(){ } 00053 00054 // check available infos 00055 bool hasMuonRef() const { return muonRef_.isNonnull(); } 00056 bool hasMTMuonRef() const { return MTMuonRef_.isNonnull(); } 00057 bool hasTrackRef() const { return trackRef_.isNonnull(); } 00058 bool hasTrackIsoRef() const { return trackIsoRef_.isNonnull(); } 00059 bool hasRpcInfo() const { return rpc_.beta!=-9999; } 00060 bool hasCaloInfo() const { return caloInfoRef_.isNonnull(); } 00061 00062 // set infos 00063 void setMuon (const reco::MuonRef& data) {muonRef_ = data;} 00064 void setMTMuon (const reco::MuonRef& data) {MTMuonRef_ = data;} 00065 void setTrack (const reco::TrackRef& data) {trackRef_ = data;} 00066 void setTrackIso (const reco::TrackRef& data) {trackIsoRef_ = data;} 00067 void setRpc (const RPCBetaMeasurement& data) {rpc_ = data;} 00068 void setCaloInfo (const HSCPCaloInfoRef& data) {caloInfoRef_ = data;} 00069 00070 00071 // get infos 00072 reco::TrackRef trackRef () const { return trackRef_; } 00073 reco::TrackRef trackIsoRef () const { return trackIsoRef_; } 00074 reco::MuonRef muonRef () const { return muonRef_; } 00075 reco::MuonRef MTMuonRef () const { return MTMuonRef_; } 00076 HSCPCaloInfoRef caloInfoRef () const { return caloInfoRef_; } 00077 const RPCBetaMeasurement& rpc () const { return rpc_; } 00078 00079 // shortcut of long function 00080 float p () const; 00081 float pt() const; 00082 int type() const; 00083 00084 private: 00085 reco::TrackRef trackRef_; //TrackRef from refitted track collection (dE/dx purposes) 00086 reco::TrackRef trackIsoRef_; //TrackRef from general track collection (isolation purposes) 00087 reco::MuonRef muonRef_; 00088 reco::MuonRef MTMuonRef_; //Muon reconstructed from MT muon segments. SA only 00089 HSCPCaloInfoRef caloInfoRef_; 00090 00091 RPCBetaMeasurement rpc_; 00092 }; 00093 00094 typedef std::vector<HSCParticle> HSCParticleCollection; 00095 typedef edm::Ref<HSCParticleCollection> HSCParticleRef; 00096 typedef edm::RefProd<HSCParticleCollection> HSCParticleRefProd; 00097 typedef edm::RefVector<HSCParticleCollection> HSCParticleRefVector; 00098 typedef edm::AssociationMap<edm::OneToOne<reco::TrackCollection, EcalRecHitCollection> > TracksEcalRecHitsMap; 00099 } 00100 #endif