28 #include <unordered_map> 33 static const std::vector<std::string>
sDETS{
"",
"PXB",
"PXF",
"TIB",
"TID",
"TOB",
"TEC"};
53 std::unordered_map<std::string, MonitorElement *>
histosEta_;
116 "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.);
120 ibook.
book2D(
"DeltaP_in_out_vs_eta_2d",
"DeltaP_in_out_vs_eta_2d", 100, -3.0, 3.0, 100, 0., 1);
129 ibook.
bookProfile(
"DeltaP_in_out_vs_eta",
"DeltaP_in_out_vs_eta", 100, -3.0, 3.0, -100., 100.);
135 ibook.
bookProfile(
"DeltaPt_in_out_vs_eta",
"DeltaPt_in_out_vs_eta", 100, -3.0, 3.0, -100., 100.);
144 ibook.
bookProfile(
"DeltaPz_in_out_vs_eta",
"DeltaPz_in_out_vs_eta", 100, -3.0, 3.0, -100., 100.);
155 P_vs_eta_2d_ = ibook.
book2D(
"P_vs_eta_2d",
"P_vs_eta_2d", 100, -3.0, 3.0, 100., 0., 5.);
158 for (
unsigned int det = 1; det <
sDETS.size(); ++det) {
159 for (
unsigned int sub_det = 1; sub_det <= trackerGeometry->
numberOfLayers(det); ++sub_det) {
160 memset(title, 0,
sizeof(title));
161 snprintf(title,
sizeof(title),
"Original_RadLen_vs_Eta_%s%d",
sDETS[det].
data(), sub_det);
162 snprintf(key,
sizeof(key),
"%s%d",
sDETS[det].
data(), sub_det);
164 make_pair<string, MonitorElement *>(key, ibook.
bookProfile(title, title, 250, -5.0, 5.0, 0., 1.)));
165 snprintf(title,
sizeof(title),
"RadLen_vs_Eta_%s%d",
sDETS[det].
data(), sub_det);
167 make_pair<string, MonitorElement *>(key, ibook.
bookProfile(title, title, 250, -5.0, 5.0, 0., 1.)));
175 using namespace reco;
189 if (!tracks.
isValid() || tracks->empty()) {
190 LogInfo(
"TrackingRecoMaterialAnalyser") <<
"Invalid or empty track collection" << endl;
210 if (vertices.
isValid() && !vertices->empty()) {
215 const Vertex &
v = (*vertices)[0];
216 if (!v.
isFake() && v.
ndof() > 4 && std::fabs(v.
z()) < 24 && std::fabs(v.
position().rho()) < 2)
239 for (
auto const track : *tracks) {
240 if (!selector(track,
pv))
256 if (traj.size() > 1 || traj.empty())
258 for (
auto const &tm : traj.front().measurements()) {
259 if (tm.recHit().get() &&
261 current_tsos = tm.updatedState().
isValid() ? tm.updatedState() : tm.forwardPredictedState();
263 current_det = tm.recHit()->geographicalId();
265 assert(tm.recHit()->surface() == &surface);
267 LogError(
"TrackingRecoMaterialAnalyser")
268 <<
"Medium properties for material linked to detector" 273 float p2 = localP.mag2();
277 float xi = ori_xi * xf;
278 float radLen = ori_radLen * xf;
299 LogTrace(
"TrackingRecoMaterialAnalyser")
300 <<
"Eta: " << track.
eta() <<
" " <<
sDETS[current_det.
subdetId()] << trk_topology->
layer(current_det)
301 <<
" has ori_radLen: " << ori_radLen <<
" and ori_xi: " << xi <<
" and has radLen: " << radLen
302 <<
" and xi: " << xi << endl;
313 LogInfo(
"TrackingRecoMaterialAnalyser")
314 <<
"Eta: " << track.
eta() <<
" " <<
sDETS[current_det.
subdetId()] << trk_topology->
layer(current_det)
315 <<
" has ori_radLen: " << ori_radLen <<
" and ori_xi: " << xi <<
" and has radLen: " << radLen
316 <<
" and xi: " << xi << endl;
double p() const
momentum vector magnitude
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_
~TrackingRecoMaterialAnalyser() override
void setCurrentFolder(std::string const &fullpath)
std::vector< Track > TrackCollection
collection of Tracks
GlobalPoint globalPosition() const
std::vector< Vertex > VertexCollection
collection of Vertex objects
std::unordered_map< std::string, MonitorElement * > histosEta_
const edm::EDGetTokenT< reco::TrackCollection > tracksToken_
MonitorElement * deltaPt_in_out_2d_
const edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
const math::XYZPoint & outerPosition() const
position of the outermost hit
const Point & position() const
position
static const std::vector< std::string > sDETS
unsigned int numberOfLayers(int subdet) const
double outerZ() const
z coordinate of the outermost hit position
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
int numberOfLostTrackerHits(HitCategory category) const
std::unordered_map< std::string, MonitorElement * > histosOriEta_
LocalVector localMomentum() const
MonitorElement * deltaPl_in_out_vs_z_
const SurfaceType & surface() const
#define DEFINE_FWK_MODULE(type)
double eta() const
pseudorapidity of momentum vector
MonitorElement * deltaP_in_out_vs_eta_
MonitorElement * histo_RZ_
MonitorElement * histo_RZ_Ori_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
static constexpr auto UNKNOWN
Abs< T >::type abs(const T &t)
double z() const
z coordinate
math::XYZPoint Point
point in the space
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")
TrackingRecoMaterialAnalyser(const edm::ParameterSet &)
Detector identifier class for the strip tracker.
MonitorElement * deltaPt_in_out_vs_z_
SubDetector subDetector() const
static TrackQuality qualityByName(const std::string &name)
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
MonitorElement * deltaPt_in_out_vs_eta_
TrackTransformer refitter_
MonitorElement * deltaP_in_out_vs_eta_2d_
bool quality(const TrackQuality) const
Track quality.
unsigned int layer(const DetId &id) const
char data[epos_bytes_allocation]
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
bool isDoubleSided(SiStripDetId strip_id)
MonitorElement * deltaPl_in_out_vs_eta_
MonitorElement * deltaP_in_out_vs_z_
const Point & position() const
position
MonitorElement * P_vs_eta_2d_
void analyze(const edm::Event &, const edm::EventSetup &) override
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
const MediumProperties & mediumProperties() const