25 #include <unordered_map>
30 static const std::vector<std::string>
sDETS{
"",
"PXB",
"PXF",
"TIB",
"TID",
"TOB",
"TEC"};
50 std::unordered_map<std::string, MonitorElement *>
histosEta_;
68 : refitter_(iPSet, consumesCollector()),
74 usePV_(iPSet.getParameter<bool>(
"usePV")),
77 histo_RZ_Ori_(nullptr),
78 deltaPt_in_out_2d_(nullptr),
79 deltaP_in_out_vs_eta_(nullptr),
80 deltaP_in_out_vs_z_(nullptr),
81 deltaP_in_out_vs_eta_2d_(nullptr),
82 deltaP_in_out_vs_eta_vs_phi_2d_(nullptr),
83 deltaP_in_out_vs_z_2d_(nullptr),
84 deltaPt_in_out_vs_eta_(nullptr),
85 deltaPt_in_out_vs_z_(nullptr),
86 deltaPl_in_out_vs_eta_(nullptr),
87 deltaPl_in_out_vs_z_(nullptr),
88 P_vs_eta_2d_(nullptr) {}
114 "DeltaP_in_out_vs_eta_vs_phi_2d",
"DeltaP_in_out_vs_eta_vs_phi_2d", 100, -3.0, 3.0, 100, -3.15, 3.15, 0., 100.);
118 ibook.
book2D(
"DeltaP_in_out_vs_eta_2d",
"DeltaP_in_out_vs_eta_2d", 100, -3.0, 3.0, 100, 0., 1);
127 ibook.
bookProfile(
"DeltaP_in_out_vs_eta",
"DeltaP_in_out_vs_eta", 100, -3.0, 3.0, -100., 100.);
133 ibook.
bookProfile(
"DeltaPt_in_out_vs_eta",
"DeltaPt_in_out_vs_eta", 100, -3.0, 3.0, -100., 100.);
142 ibook.
bookProfile(
"DeltaPz_in_out_vs_eta",
"DeltaPz_in_out_vs_eta", 100, -3.0, 3.0, -100., 100.);
153 P_vs_eta_2d_ = ibook.
book2D(
"P_vs_eta_2d",
"P_vs_eta_2d", 100, -3.0, 3.0, 100., 0., 5.);
156 for (
unsigned int det = 1; det <
sDETS.size(); ++det) {
157 for (
unsigned int sub_det = 1; sub_det <= trackerGeometry.numberOfLayers(det); ++sub_det) {
173 using namespace reco;
186 LogInfo(
"TrackingRecoMaterialAnalyser") <<
"Invalid or empty track collection" << endl;
192 return (
track.quality(
track.qualityByName(
"highPurity")) &&
track.dxy(
pv) < 0.01 &&
193 track.hitPattern().numberOfLostTrackerHits(HitPattern::MISSING_OUTER_HITS) == 0);
209 const Vertex &
v = (*vertices)[0];
210 if (!v.
isFake() && v.
ndof() > 4 && std::fabs(v.
z()) < 24 && std::fabs(v.
position().rho()) < 2)
250 if (traj.size() > 1 || traj.empty())
252 for (
auto const &tm : traj.front().measurements()) {
253 if (tm.recHit().get() &&
255 current_tsos = tm.updatedState().isValid() ? tm.updatedState() : tm.forwardPredictedState();
256 auto const &localP = current_tsos.localMomentum();
257 current_det = tm.recHit()->geographicalId();
258 const Surface &surface = current_tsos.surface();
259 assert(tm.recHit()->surface() == &surface);
261 LogError(
"TrackingRecoMaterialAnalyser")
262 <<
"Medium properties for material linked to detector"
263 <<
" are invalid at: " << current_tsos.globalPosition() <<
" " << (
SiStripDetId)current_det << endl;
267 float p2 = localP.mag2();
271 float xi = ori_xi * xf;
272 float radLen = ori_radLen * xf;
293 LogTrace(
"TrackingRecoMaterialAnalyser")
294 <<
"Eta: " <<
track.eta() <<
" " <<
sDETS[current_det.subdetId()] << tTopo->layer(current_det)
295 <<
" has ori_radLen: " << ori_radLen <<
" and ori_xi: " << xi <<
" and has radLen: " << radLen
296 <<
" and xi: " << xi << endl;
302 current_tsos.globalPosition().eta(), ori_radLen);
304 current_tsos.globalPosition().eta(), radLen);
305 histo_RZ_Ori_->
Fill(current_tsos.globalPosition().z(), current_tsos.globalPosition().perp(), ori_radLen);
306 histo_RZ_->
Fill(current_tsos.globalPosition().z(), current_tsos.globalPosition().perp(), radLen);
307 LogInfo(
"TrackingRecoMaterialAnalyser")
308 <<
"Eta: " <<
track.eta() <<
" " <<
sDETS[current_det.subdetId()] << tTopo->layer(current_det)
309 <<
" has ori_radLen: " << ori_radLen <<
" and ori_xi: " << xi <<
" and has radLen: " << radLen
310 <<
" and xi: " << xi << endl;
void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
const edm::EDGetTokenT< reco::VertexCollection > verticesToken_
MonitorElement * deltaP_in_out_vs_z_2d_
MonitorElement * deltaP_in_out_vs_eta_vs_phi_2d_
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
~TrackingRecoMaterialAnalyser() override
virtual void setCurrentFolder(std::string const &fullpath)
#define DEFINE_FWK_MODULE(type)
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryTokenRun_
std::vector< Track > TrackCollection
collection of Tracks
bool isDoubleSided(const TrackerTopology *tTopo, DetId id)
std::unordered_map< std::string, MonitorElement * > histosEta_
const edm::EDGetTokenT< reco::TrackCollection > tracksToken_
auto const & tracks
cannot be loose
MonitorElement * deltaPt_in_out_2d_
const edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
Log< level::Error, false > LogError
std::vector< Vertex > VertexCollection
const Point & position() const
position
static const std::vector< std::string > sDETS
std::unordered_map< std::string, MonitorElement * > histosOriEta_
bool getData(T &iHolder) const
MonitorElement * deltaPl_in_out_vs_z_
MonitorElement * deltaP_in_out_vs_eta_
MonitorElement * histo_RZ_
MonitorElement * histo_RZ_Ori_
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
tuple key
prepare the HTCondor submission files and eventually submit them
Abs< T >::type abs(const T &t)
double z() const
z coordinate
math::XYZPoint Point
point in the space
TrackingRecoMaterialAnalyser(const edm::ParameterSet &)
Log< level::Info, false > LogInfo
Detector identifier class for the strip tracker.
MonitorElement * deltaPt_in_out_vs_z_
MonitorElement * deltaPt_in_out_vs_eta_
TrackTransformer refitter_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * deltaP_in_out_vs_eta_2d_
char data[epos_bytes_allocation]
MonitorElement * deltaPl_in_out_vs_eta_
MonitorElement * deltaP_in_out_vs_z_
MonitorElement * P_vs_eta_2d_
void analyze(const edm::Event &, const edm::EventSetup &) override
const MediumProperties & mediumProperties() const
uint32_t glued(const DetId &id) const