Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:46:21

0001 #ifndef HSCParticle_H
0002 #define HSCParticle_H
0003 #include "DataFormats/Common/interface/AssociationVector.h"
0004 #include "DataFormats/Common/interface/AssociationMap.h"
0005 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0006 #include "DataFormats/MuonReco/interface/Muon.h"
0007 #include "DataFormats/TrackReco/interface/Track.h"
0008 #include "DataFormats/TrackReco/interface/DeDxData.h"
0009 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0010 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0011 #include <vector>
0012 
0013 #include "DataFormats/MuonReco/interface/MuonTimeExtra.h"
0014 #include "AnalysisDataFormats/SUSYBSMObjects/interface/HSCPCaloInfo.h"
0015 
0016 namespace susybsm {
0017 
0018   /// define arbitration schemes
0019   namespace HSCParticleType {
0020     enum Type { globalMuon, trackerMuon, matchedStandAloneMuon, standAloneMuon, innerTrack, unknown };
0021   }
0022 
0023   class RPCHit4D {
0024   public:
0025     int id;
0026     int bx;
0027     GlobalPoint gp;
0028     bool operator<(const RPCHit4D& other) const { return gp.mag() < other.gp.mag(); }
0029   };
0030 
0031   class RPCBetaMeasurement {
0032   public:
0033     bool isCandidate;
0034     float beta;
0035 
0036     RPCBetaMeasurement() {
0037       isCandidate = false;
0038       beta = -9999;
0039     }
0040   };
0041 
0042   class HSCParticle {
0043   public:
0044     // constructor
0045     HSCParticle() {}
0046 
0047     // check available infos
0048     bool hasMuonRef() const { return muonRef_.isNonnull(); }
0049     bool hasMTMuonRef() const { return MTMuonRef_.isNonnull(); }
0050     bool hasTrackRef() const { return trackRef_.isNonnull(); }
0051     bool hasTrackIsoRef() const { return trackIsoRef_.isNonnull(); }
0052     bool hasRpcInfo() const { return rpc_.beta != -9999; }
0053     bool hasCaloInfo() const { return caloInfoRef_.isNonnull(); }
0054 
0055     // set infos
0056     void setMuon(const reco::MuonRef& data) { muonRef_ = data; }
0057     void setMTMuon(const reco::MuonRef& data) { MTMuonRef_ = data; }
0058     void setTrack(const reco::TrackRef& data) { trackRef_ = data; }
0059     void setTrackIso(const reco::TrackRef& data) { trackIsoRef_ = data; }
0060     void setRpc(const RPCBetaMeasurement& data) { rpc_ = data; }
0061     void setCaloInfo(const HSCPCaloInfoRef& data) { caloInfoRef_ = data; }
0062 
0063     // get infos
0064     reco::TrackRef trackRef() const { return trackRef_; }
0065     reco::TrackRef trackIsoRef() const { return trackIsoRef_; }
0066     reco::MuonRef muonRef() const { return muonRef_; }
0067     reco::MuonRef MTMuonRef() const { return MTMuonRef_; }
0068     HSCPCaloInfoRef caloInfoRef() const { return caloInfoRef_; }
0069     const RPCBetaMeasurement& rpc() const { return rpc_; }
0070 
0071     // shortcut of long function
0072     float p() const;
0073     float pt() const;
0074     int type() const;
0075 
0076   private:
0077     reco::TrackRef trackRef_;     //TrackRef from refitted track collection (dE/dx purposes)
0078     reco::TrackRef trackIsoRef_;  //TrackRef from general track collection (isolation purposes)
0079     reco::MuonRef muonRef_;
0080     reco::MuonRef MTMuonRef_;  //Muon reconstructed from MT muon segments.  SA only
0081     HSCPCaloInfoRef caloInfoRef_;
0082 
0083     RPCBetaMeasurement rpc_;
0084   };
0085 
0086   typedef std::vector<HSCParticle> HSCParticleCollection;
0087   typedef edm::Ref<HSCParticleCollection> HSCParticleRef;
0088   typedef edm::RefProd<HSCParticleCollection> HSCParticleRefProd;
0089   typedef edm::RefVector<HSCParticleCollection> HSCParticleRefVector;
0090   typedef edm::AssociationMap<edm::OneToOne<reco::TrackCollection, EcalRecHitCollection> > TracksEcalRecHitsMap;
0091 }  // namespace susybsm
0092 #endif