Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-11-09 11:29:10

0001 #ifndef Alignment_OfflineValidation_TrackerTrackerValidationVariables_h
0002 #define Alignment_OfflineValidation_TrackerTrackerValidationVariables_h
0003 
0004 // system include files
0005 #include <vector>
0006 
0007 #include "FWCore/Utilities/interface/EDGetToken.h"
0008 #include "FWCore/Utilities/interface/ESGetToken.h"
0009 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0010 #include "MagneticField/Engine/interface/MagneticField.h"
0011 #include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h"
0012 
0013 class Trajectory;
0014 
0015 namespace edm {
0016   class ConsumesCollector;
0017   class Event;
0018   class EventSetup;
0019   class ParameterSet;
0020 }  // namespace edm
0021 
0022 class TrackerValidationVariables {
0023 public:
0024   struct AVHitStruct {
0025     AVHitStruct()
0026         : resX(-999.),
0027           resY(-999.),
0028           resErrX(-999.),
0029           resErrY(-999.),
0030           resXprime(-999.),
0031           resXatTrkY(-999.),
0032           resXprimeErr(-999.),
0033           resYprime(-999.),
0034           resYprimeErr(-999.),
0035           phi(-999.),
0036           eta(-999.),
0037           inside(false),
0038           localX(-999.),
0039           localY(-999.),
0040           localXnorm(-999.),
0041           localYnorm(-999.),
0042           localAlpha(-999.),
0043           localBeta(-999.),
0044           rawDetId(0),
0045           isOnEdgePixel(false),
0046           isOtherBadPixel(false) {}
0047     float resX;
0048     float resY;
0049     float resErrX;
0050     float resErrY;
0051     float resXprime;
0052     float resXatTrkY;
0053     float resXprimeErr;
0054     float resYprime;
0055     float resYprimeErr;
0056     float phi;
0057     float eta;
0058     bool inside;
0059     float localX;
0060     float localY;
0061     float localXnorm;
0062     float localYnorm;
0063     float localAlpha;
0064     float localBeta;
0065     uint32_t rawDetId;
0066     bool isOnEdgePixel;
0067     bool isOtherBadPixel;
0068   };
0069 
0070   struct AVTrackStruct {
0071     AVTrackStruct()
0072         : p(0.),
0073           pt(0.),
0074           ptError(0.),
0075           px(0.),
0076           py(0.),
0077           pz(0.),
0078           eta(0.),
0079           phi(0.),
0080           kappa(0.),
0081           chi2(0.),
0082           chi2Prob(0.),
0083           normchi2(0),
0084           d0(-999.),
0085           dz(-999.),
0086           charge(-999),
0087           numberOfValidHits(0),
0088           numberOfLostHits(0){};
0089     float p;
0090     float pt;
0091     float ptError;
0092     float px;
0093     float py;
0094     float pz;
0095     float eta;
0096     float phi;
0097     float kappa;
0098     float chi2;
0099     float chi2Prob;
0100     float normchi2;
0101     float d0;
0102     float dz;
0103     int charge;
0104     int numberOfValidHits;
0105     int numberOfLostHits;
0106     std::vector<AVHitStruct> hits;
0107   };
0108 
0109   TrackerValidationVariables(const edm::ParameterSet& config, edm::ConsumesCollector&& iC);
0110   ~TrackerValidationVariables();
0111 
0112   void fillHitQuantities(const Trajectory* trajectory, std::vector<AVHitStruct>& v_avhitout);
0113   void fillHitQuantities(reco::Track const& track, std::vector<AVHitStruct>& v_avhitout);
0114   void fillTrackQuantities(const edm::Event&, const edm::EventSetup&, std::vector<AVTrackStruct>& v_avtrackout);
0115   // all Tracks are passed to the trackFilter first, and only processed if it returns true.
0116   void fillTrackQuantities(const edm::Event& event,
0117                            const edm::EventSetup& eventSetup,
0118                            std::function<bool(const reco::Track&)> trackFilter,
0119                            std::vector<AVTrackStruct>& v_avtrackout);
0120 
0121 private:
0122   edm::EDGetTokenT<std::vector<Trajectory>> trajCollectionToken_;
0123   edm::EDGetTokenT<std::vector<reco::Track>> tracksToken_;
0124   edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magneticFieldToken_;
0125 };
0126 
0127 #endif