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 hasTrackRef() const { return trackRef_.isNonnull(); } 00057 bool hasTrackIsoRef() const { return trackIsoRef_.isNonnull(); } 00058 bool hasRpcInfo() const { return rpc_.beta!=-9999; } 00059 bool hasCaloInfo() const { return caloInfoRef_.isNonnull(); } 00060 00061 // set infos 00062 void setMuon (const reco::MuonRef& data) {muonRef_ = data;} 00063 void setTrack (const reco::TrackRef& data) {trackRef_ = data;} 00064 void setTrackIso (const reco::TrackRef& data) {trackIsoRef_ = data;} 00065 void setRpc (const RPCBetaMeasurement& data) {rpc_ = data;} 00066 void setCaloInfo (const HSCPCaloInfoRef& data) {caloInfoRef_ = data;} 00067 00068 00069 // get infos 00070 reco::TrackRef trackRef () const { return trackRef_; } 00071 reco::TrackRef trackIsoRef () const { return trackIsoRef_; } 00072 reco::MuonRef muonRef () const { return muonRef_; } 00073 HSCPCaloInfoRef caloInfoRef () const { return caloInfoRef_; } 00074 const RPCBetaMeasurement& rpc () const { return rpc_; } 00075 00076 // shortcut of long function 00077 float p () const; 00078 float pt() const; 00079 int type() const; 00080 00081 private: 00082 reco::TrackRef trackRef_; //TrackRef from refitted track collection (dE/dx purposes) 00083 reco::TrackRef trackIsoRef_; //TrackRef from general track collection (isolation purposes) 00084 reco::MuonRef muonRef_; 00085 HSCPCaloInfoRef caloInfoRef_; 00086 00087 RPCBetaMeasurement rpc_; 00088 }; 00089 00090 typedef std::vector<HSCParticle> HSCParticleCollection; 00091 typedef edm::Ref<HSCParticleCollection> HSCParticleRef; 00092 typedef edm::RefProd<HSCParticleCollection> HSCParticleRefProd; 00093 typedef edm::RefVector<HSCParticleCollection> HSCParticleRefVector; 00094 typedef edm::AssociationMap<edm::OneToOne<reco::TrackCollection, EcalRecHitCollection> > TracksEcalRecHitsMap; 00095 } 00096 00097 #endif