Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:32:37

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