30 trackerHitAssociatorConfig_(ps, consumesCollector())
55 switchNumrphi = ParametersNumrphi.getParameter<
bool>(
"switchon");
85 switchAdcrphi = ParametersAdcrphi.getParameter<
bool>(
"switchon");
88 switchPosxrphi = ParametersPosxrphi.getParameter<
bool>(
"switchon");
94 switchResrphi = ParametersResrphi.getParameter<
bool>(
"switchon");
103 switchChi2rphi = ParametersChi2rphi.getParameter<
bool>(
"switchon");
165 edm::LogInfo(
"SiStripRecHitsValid") <<
"SiStripRecHitsValid::beginRun: "
166 <<
" Creating MEs for new Cabling ";
187 std::map<std::string, int> totnumrechitrphi;
188 std::map<std::string, int> totnumrechitstereo;
189 std::map<std::string, int> totnumrechitmatched;
190 int totrechitrphi = 0;
191 int totrechitstereo = 0;
192 int totrechitmatched = 0;
200 for (
auto const& theDetSet : *rechitsrphi) {
201 DetId detid = theDetSet.detId();
202 uint32_t myid = detid.
rawId();
203 totrechitrphi += theDetSet.size();
206 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(label);
207 std::pair<std::string, int32_t> det_lay_pair = fold_organ.
GetSubDetAndLayer(myid, tTopo,
true);
209 totnumrechitrphi[det_lay_pair.first] = totnumrechitrphi[det_lay_pair.first] + theDetSet.size();
212 for (
auto const& rechit : theDetSet) {
224 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find(det_lay_pair.first);
240 for (
auto const& theDetSet : *rechitsstereo) {
241 DetId detid = theDetSet.detId();
242 uint32_t myid = detid.
rawId();
243 totrechitstereo += theDetSet.size();
246 std::map<std::string, StereoAndMatchedMEs>::iterator iStereoAndMatchedME =
StereoAndMatchedMEsMap.find(label);
247 std::pair<std::string, int32_t> det_lay_pair = fold_organ.
GetSubDetAndLayer(myid, tTopo,
true);
249 totnumrechitstereo[det_lay_pair.first] = totnumrechitstereo[det_lay_pair.first] + theDetSet.size();
252 for (
auto const& rechit : theDetSet) {
264 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find(det_lay_pair.first);
280 for (
auto const& theDetSet : *rechitsmatched) {
281 DetId detid = theDetSet.detId();
282 uint32_t myid = detid.
rawId();
283 totrechitmatched += theDetSet.size();
286 std::map<std::string, StereoAndMatchedMEs>::iterator iStereoAndMatchedME =
StereoAndMatchedMEsMap.find(label);
287 std::pair<std::string, int32_t> det_lay_pair = fold_organ.
GetSubDetAndLayer(myid, tTopo,
true);
289 totnumrechitmatched[det_lay_pair.first] = totnumrechitmatched[det_lay_pair.first] + theDetSet.size();
292 for (
auto const& rechit : theDetSet) {
303 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find(det_lay_pair.first);
318 for (std::vector<std::string>::iterator iSubdet =
SubDetList_.begin(); iSubdet !=
SubDetList_.end(); ++iSubdet) {
319 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find((*iSubdet));
320 fillME(iSubDetME->second.meNumrphi, totnumrechitrphi[(*iSubdet)]);
321 fillME(iSubDetME->second.meNumStereo, totnumrechitstereo[(*iSubdet)]);
322 fillME(iSubDetME->second.meNumMatched, totnumrechitmatched[(*iSubdet)]);
339 LocalPoint localHit = plane.toLocal(globalpos);
346 double scale = -localHit.
z() / dir.
z();
356 return std::pair<LocalPoint, LocalVector>(projectedPos, localStripDir);
373 const auto& amplitudes = (rechit.
cluster())->amplitudes();
375 for (
auto ia : amplitudes) {
390 if (!matched.empty()) {
393 PSimHit const* closest =
nullptr;
395 for (
auto const&
m : matched) {
397 if (dist < mindist) {
414 rhparameters[0] = position.
x();
415 rhparameters[1] = position.
y();
421 R[0][0] = error.
xx();
422 R[0][1] = error.
xy();
423 R[1][1] = error.
yy();
426 float est = R.similarity(r);
464 PSimHit const* closest =
nullptr;
465 std::pair<LocalPoint, LocalVector> closestPair;
468 std::pair<LocalPoint, LocalVector> hitPair;
470 for (
auto const&
m : matched) {
472 if (hitDetId.stereo()) {
477 dist2 = distx * distx + disty * disty;
479 if (dist < mindist) {
481 closestPair = hitPair;
496 rhparameters[0] = position.
x();
497 rhparameters[1] = position.
y();
500 shparameters[0] = sh.
x();
501 shparameters[1] = sh.
y();
504 R[0][0] = error.
xx();
505 R[0][1] = error.
xy();
506 R[1][1] = error.
yy();
509 float est = R.similarity(r);
533 edm::LogInfo(
"SiStripTkRecHits|SiStripRecHitsValid") <<
"nr. of activeDets: " << activeDets.size();
534 const std::string &tec =
"TEC", tid =
"TID", tob =
"TOB", tib =
"TIB";
535 for (
auto detid_iterator = activeDets.begin(), detid_end = activeDets.end(); detid_iterator != detid_end;
537 uint32_t detid = (*detid_iterator);
540 activeDets.erase(detid_iterator);
545 std::pair<std::string, int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
true);
552 int32_t lnumber = det_layer_pair.second;
554 std::vector<uint32_t> layerDetIds;
558 }
else if (lnumber < 0) {
561 }
else if (lname == tid) {
564 }
else if (lnumber < 0) {
567 }
else if (lname == tob) {
569 }
else if (lname == tib) {
575 folder_organizer.
setLayerFolder(detid, tTopo, det_layer_pair.second,
true);
587 bool isStereo =
false;
589 std::vector<uint32_t> stereoandmatchedDetIds;
590 int32_t stereolnumber = det_layer_pair.second;
591 const std::string& stereolname = det_layer_pair.first;
592 if (stereolname == tec && (tTopo->
tecIsStereo(detid))) {
593 if (stereolnumber > 0) {
595 activeDets, stereoandmatchedDetIds, tTopo, 2, 0, 0, 0,
abs(stereolnumber), 1);
597 }
else if (stereolnumber < 0) {
599 activeDets, stereoandmatchedDetIds, tTopo, 1, 0, 0, 0,
abs(stereolnumber), 1);
602 }
else if (stereolname == tid && (tTopo->
tidIsStereo(detid))) {
603 if (stereolnumber > 0) {
606 }
else if (stereolnumber < 0) {
610 }
else if (stereolname == tob && (tTopo->
tobIsStereo(detid))) {
613 }
else if (stereolname == tib && (tTopo->
tibIsStereo(detid))) {
622 folder_organizer.
setLayerFolder(detid, tTopo, det_layer_pair.second,
true);
671 "Cluster Width - Number of strips that belong to the RecHit cluster");
679 "RecHit Cluster Charge");
695 "RecHit resol(x) coord.");
703 "Residuals of the hit x coordinate");
711 "Pull distribution");
719 "Pull distribution");
735 "No. of assoc. simHits");
770 "Cluster Width - Number of strips that belong to the RecHit cluster");
778 "RecHit Cluster Charge");
795 "RecHit resol(x) coord.");
804 "Residuals of the hit x coordinate");
813 "Pull distribution");
822 "Pull distribution");
840 "No. of assoc. simHits");
867 "RecHit resol(x) coord.");
876 "RecHit resol(y) coord.");
885 "Residuals of the hit x coord.");
894 "Residuals of the hit y coord.");
912 "No. of assoc. simHits");
934 HistoName =
"TH1Numrphi__" +
label;
935 subdetMEs.
meNumrphi =
bookME1D(ibooker,
"TH1Numrphi", HistoName.c_str(),
"Num of RecHits");
940 HistoName =
"TH1Bunchrphi__" +
label;
941 subdetMEs.
meBunchrphi =
bookME1D(ibooker,
"TH1Bunchrphi", HistoName.c_str(),
"Bunch Crossing");
946 HistoName =
"TH1Eventrphi__" +
label;
947 subdetMEs.
meEventrphi =
bookME1D(ibooker,
"TH1Eventrphi", HistoName.c_str(),
"Event (in-time bunch)");
952 HistoName =
"TH1NumStereo__" +
label;
953 subdetMEs.
meNumStereo =
bookME1D(ibooker,
"TH1NumStereo", HistoName.c_str(),
"Num of RecHits in stereo modules");
958 HistoName =
"TH1BunchStereo__" +
label;
964 HistoName =
"TH1EventStereo__" +
label;
965 subdetMEs.
meEventStereo =
bookME1D(ibooker,
"TH1EventStereo", HistoName.c_str(),
"Event (in-time bunch)");
970 HistoName =
"TH1NumMatched__" +
label;
971 subdetMEs.
meNumMatched =
bookME1D(ibooker,
"TH1NumMatched", HistoName.c_str(),
"Num of matched RecHits");
976 HistoName =
"TH1BunchMatched__" +
label;
982 HistoName =
"TH1EventMatched__" +
label;
983 subdetMEs.
meEventMatched =
bookME1D(ibooker,
"TH1EventMatched", HistoName.c_str(),
"Event (in-time bunch)");
991 const char* ParameterSetLabel,
993 const char* HistoTitle) {
995 return ibooker.
book1D(HistoName,
RecHitProperties rechitpro
MonitorElement * meAdcStereo
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
EventNumber_t event() const
MonitorElement * meEventMatched
std::vector< std::string > SubDetList_
MonitorElement * meEventStereo
edm::ESWatcher< SiStripDetCablingRcd > watchSiStripDetCablingRcd_
void rechitanalysis_matched(SiStripMatchedRecHit2D const rechit, const GluedGeomDet *gluedDet, TrackerHitAssociator &associate)
void getTIBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tibDetRawIds, const TrackerTopology *trackerTopology, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t int_ext=0, uint32_t string=0)
void createStereoAndMatchedMEs(DQMStore::IBooker &ibooker, std::string label)
int event() const
get the contents of the subdetector field (should be protected?)
void setSiStripFolderName(std::string name)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
MonitorElement * meNumMatched
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &run, const edm::EventSetup &es) override
virtual float stripAngle(float strip) const =0
std::pair< const std::string, const char * > getSubDetFolderAndTag(const uint32_t &detid, const TrackerTopology *tTopo)
bool tobIsStereo(const DetId &id) const
virtual void setCurrentFolder(std::string const &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void createSubDetMEs(DQMStore::IBooker &ibooker, std::string label)
TrackerHitAssociator::Config trackerHitAssociatorConfig_
#define DEFINE_FWK_MODULE(type)
MonitorElement * meNumTotStereo
std::map< std::string, SubDetMEs > SubDetMEsMap
void rechitanalysis(SiStripRecHit2D const rechit, const StripTopology &topol, TrackerHitAssociator &associate)
Sin< T >::type sin(const T &t)
constexpr uint32_t rawId() const
get the raw id
MonitorElement * mePullLFStereo
std::map< std::string, StereoAndMatchedMEs > StereoAndMatchedMEsMap
void getTIDDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tidDetRawIds, const TrackerTopology *trackerTopology, uint32_t side=0, uint32_t wheel=0, uint32_t ring=0, uint32_t ster=0)
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=false)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > m_topoToken
void getTECDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tecDetRawIds, const TrackerTopology *trackerTopology, uint32_t side=0, uint32_t wheel=0, uint32_t petal_bkw_frw=0, uint32_t petal=0, uint32_t ring=0, uint32_t ster=0)
MonitorElement * meNsimHitrphi
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
MonitorElement * mePullLFrphi
const Plane & surface() const
The nominal surface of the GeomDet.
MonitorElement * meResolxMatched
MonitorElement * mePullMFStereo
void analyze(const edm::Event &e, const edm::EventSetup &c) override
bool tidIsStereo(const DetId &id) const
virtual float strip(const LocalPoint &) const =0
edm::EDGetTokenT< SiStripRecHit2DCollection > stereoRecHitsToken_
MonitorElement * mePosxStereo
bool getData(T &iHolder) const
bool tecIsStereo(const DetId &id) const
const edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > m_SiStripDetCablingToken
MonitorElement * meChi2Stereo
MonitorElement * meResxMatched
MonitorElement * meResolxrphi
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
MonitorElement * meBunchStereo
Local3DPoint localPosition() const
MonitorElement * meBunchrphi
std::map< std::string, std::vector< uint32_t > > LayerDetMap
int bunchCrossing() const
get the detector field from this detid
MonitorElement * meWclusrphi
std::vector< uint32_t > activeDets
Cos< T >::type cos(const T &t)
std::string topFolderName_
Abs< T >::type abs(const T &t)
MonitorElement * mePosyMatched
ClusterRef cluster() const
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
void createMEs(DQMStore::IBooker &ibooker, const edm::EventSetup &es)
~SiStripRecHitsValid() override
EncodedEventId eventId() const
edm::EDGetTokenT< SiStripRecHit2DCollection > rphiRecHitsToken_
MonitorElement * meNsimHitStereo
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > m_topoTokenBR
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
MonitorElement * meChi2rphi
MonitorElement * mePosxMatched
bool switchNsimHitMatched
const TrackerGeomDet * idToDet(DetId) const override
MonitorElement * bookME1D(DQMStore::IBooker &ibooker, const char *ParameterSetLabel, const char *HistoName, const char *HistoTitle)
MonitorElement * meNumTotMatched
SiStripHistoId hidmanager
LocalVector localDirection() const
Obsolete. Same as momentumAtEntry().unit(), for backward compatibility.
SiStripRecHitsValid(const edm::ParameterSet &conf)
Log< level::Info, false > LogInfo
Detector identifier class for the strip tracker.
LocalError localPositionError() const override
std::map< std::string, LayerMEs > LayerMEsMap
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
CLHEP::HepVector AlgebraicVector
MonitorElement * meChi2Matched
bool tibIsStereo(const DetId &id) const
T getParameter(std::string const &) const
SiStripFolderOrganizer folder_organizer
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > m_geomToken
MonitorElement * meBunchMatched
MonitorElement * meAdcrphi
MonitorElement * meWclusStereo
MonitorElement * meResyMatched
std::pair< LocalPoint, LocalVector > projectHit(const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
MonitorElement * meResolyMatched
bool check(const edm::EventSetup &iSetup)
MonitorElement * meResolxStereo
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=false)
MonitorElement * meResStereo
void createTotalMEs(DQMStore::IBooker &ibooker)
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > matchedRecHitsToken_
LocalPoint localPosition() const override
static int position[264][3]
CLHEP::HepSymMatrix AlgebraicSymMatrix
void createLayerMEs(DQMStore::IBooker &ibooker, std::string label)
void fillME(MonitorElement *ME, float value1)
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
MonitorElement * meNumStereo
MonitorElement * meNsimHitMatched
MonitorElement * meEventrphi
void getTOBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tobDetRawIds, const TrackerTopology *trackerTopology, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t rod=0)
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * mePosxrphi
MonitorElement * meResrphi
std::map< std::string, std::vector< uint32_t > > StereoAndMatchedDetMap
MonitorElement * mePullMFrphi
MonitorElement * meNumrphi
const GeomDetUnit * stereoDet() const
MonitorElement * meNumTotrphi
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)