Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-08-09 23:47:33

0001 #ifndef __L1Trigger_VertexFinder_Stub_h__
0002 #define __L1Trigger_VertexFinder_Stub_h__
0003 
0004 #include "DataFormats/L1TrackTrigger/interface/TTStub.h"
0005 #include "DataFormats/L1TrackTrigger/interface/TTTypes.h"
0006 #include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h"
0007 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0008 #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h"
0009 #include "Geometry/CommonTopologies/interface/PixelTopology.h"
0010 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0011 #include "L1Trigger/VertexFinder/interface/AnalysisSettings.h"
0012 #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"
0013 #include "SimDataFormats/Associations/interface/TTClusterAssociationMap.h"
0014 #include "SimDataFormats/Associations/interface/TTStubAssociationMap.h"
0015 
0016 #include <array>
0017 #include <map>
0018 #include <set>
0019 
0020 class TrackerGeometry;
0021 
0022 namespace l1tVertexFinder {
0023 
0024   class AnalysisSettings;
0025 
0026   typedef edm::Ptr<TrackingParticle> TrackingParticlePtr;
0027   typedef edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>> DetSetVec;
0028   typedef edmNew::DetSet<TTStub<Ref_Phase2TrackerDigi_>> DetSet;
0029   typedef edm::Ref<DetSetVec, TTStub<Ref_Phase2TrackerDigi_>> TTStubRef;
0030   typedef edm::Ref<edmNew::DetSetVector<TTCluster<Ref_Phase2TrackerDigi_>>, TTCluster<Ref_Phase2TrackerDigi_>>
0031       TTClusterRef;
0032   typedef TTStubAssociationMap<Ref_Phase2TrackerDigi_> TTStubAssMap;
0033   typedef TTClusterAssociationMap<Ref_Phase2TrackerDigi_> TTClusterAssMap;
0034 
0035   //=== Represents a Tracker stub (=pair of hits)
0036 
0037   class Stub : public TTStubRef {
0038   public:
0039     // Fill useful info about stub.
0040     Stub();
0041     Stub(const TTStubRef& ttStubRef,
0042          const AnalysisSettings& settings,
0043          const TrackerGeometry* trackerGeometry,
0044          const TrackerTopology* trackerTopology);
0045     ~Stub() {}
0046 
0047     // Fill truth info with association from stub to tracking particles.
0048     void fillTruth(edm::Handle<TTStubAssMap> mcTruthTTStubHandle, edm::Handle<TTClusterAssMap> mcTruthTTClusterHandle);
0049 
0050     // === Functions for returning info about reconstructed stubs ===
0051 
0052     //--- Stub data and quantities derived from it ---
0053 
0054     // Stub coordinates (optionally after digitisation, if digitisation requested via cfg).
0055     // N.B. Digitisation is not run when the stubs are created, but later, after stubs are assigned to sectors.
0056     // Until then, these functions return the original coordinates.
0057     float phi() const { return phi_; }
0058     float r() const { return r_; }
0059     float z() const { return z_; }
0060 
0061     //--- Quantities common to all stubs in a given module ---
0062 
0063     // Module type: PS or 2S?
0064     bool psModule() const { return psModule_; }
0065     // Tracker layer ID number (1-6 = barrel layer; 11-15 = endcap A disk; 21-25 = endcap B disk)
0066     unsigned int layerId() const { return layerId_; }
0067 
0068     //--- Truth info
0069 
0070     // Association of stub to tracking particles
0071     const std::set<TrackingParticlePtr>& assocTPs() const {
0072       return assocTPs_;
0073     }  // Return TPs associated to this stub. (Whether only TPs contributing to both clusters are returned is determined by "StubMatchStrict" config param.)
0074     const TrackingParticlePtr assocTP() const {
0075       return assocTP_;
0076     }  // If only one TP contributed to both clusters, this tells you which TP it is. Returns nullptr if none.
0077 
0078   private:
0079     // Set info about the module that this stub is in.
0080     void setModuleInfo(const TrackerGeometry* trackerGeometry,
0081                        const TrackerTopology* trackerTopology,
0082                        const DetId& detId);
0083 
0084   private:
0085     const AnalysisSettings* settings_;  // configuration parameters.
0086 
0087     float phi_;  // stub coords, optionally after digitisation.
0088     float r_;
0089     float z_;
0090 
0091     //--- Parameters common to all stubs in a given module.
0092     unsigned int idDet_;
0093     float moduleMinR_;
0094     float moduleMaxR_;
0095     float moduleMinPhi_;
0096     float moduleMaxPhi_;
0097     float moduleMinZ_;
0098     float moduleMaxZ_;
0099     bool psModule_;
0100     unsigned int layerId_;
0101     unsigned int endcapRing_;
0102     bool barrel_;
0103     float sigmaPerp_;
0104     float sigmaPar_;
0105     float stripPitch_;
0106     float stripLength_;
0107     unsigned int nStrips_;
0108     float sensorWidth_;
0109     bool outerModuleAtSmallerR_;
0110     //--- Truth info about stub.
0111     TrackingParticlePtr assocTP_;
0112     std::set<TrackingParticlePtr> assocTPs_;
0113   };
0114 
0115 }  // end namespace l1tVertexFinder
0116 
0117 #endif