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 ";
173 LogInfo(
"EventInfo") <<
" Run = " <<
e.id().run() <<
" Event = " <<
e.id().event();
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();
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();
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);
356 return std::pair<LocalPoint, LocalVector>(projectedPos, localStripDir);
373 const auto& amplitudes = (rechit.
cluster())->amplitudes();
375 for (
auto ia : amplitudes) {
397 if (dist < mindist) {
417 shparameters[0] =
closest->localPosition().x();
418 shparameters[1] =
closest->localPosition().y();
426 float est =
R.similarity(
r);
465 std::pair<LocalPoint, LocalVector> closestPair;
468 std::pair<LocalPoint, LocalVector> hitPair;
472 if (hitDetId.stereo()) {
477 dist2 = distx * distx + disty * disty;
479 if (dist < mindist) {
481 closestPair = hitPair;
500 shparameters[0] = sh.
x();
501 shparameters[1] = sh.
y();
509 float est =
R.similarity(
r);
522 std::vector<uint32_t> activeDets;
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");
991 const char* ParameterSetLabel,
993 const char* HistoTitle) {
RecHitProperties rechitpro
MonitorElement * meAdcStereo
MonitorElement * meEventMatched
std::vector< std::string > SubDetList_
T getParameter(std::string const &) const
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)
void setSiStripFolderName(std::string name)
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)
virtual void setCurrentFolder(std::string const &fullpath)
void createSubDetMEs(DQMStore::IBooker &ibooker, std::string label)
TrackerHitAssociator::Config trackerHitAssociatorConfig_
MonitorElement * meNumTotStereo
int closest(std::vector< int > const &vec, int value)
std::map< std::string, SubDetMEs > SubDetMEsMap
void rechitanalysis(SiStripRecHit2D const rechit, const StripTopology &topol, TrackerHitAssociator &associate)
Sin< T >::type sin(const T &t)
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
MonitorElement * mePullLFrphi
MonitorElement * meResolxMatched
MonitorElement * mePullMFStereo
ClusterRef cluster() const
bool tibIsStereo(const DetId &id) const
void analyze(const edm::Event &e, const edm::EventSetup &c) override
virtual float strip(const LocalPoint &) const =0
edm::EDGetTokenT< SiStripRecHit2DCollection > stereoRecHitsToken_
bool tobIsStereo(const DetId &id) const
MonitorElement * mePosxStereo
const edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > m_SiStripDetCablingToken
MonitorElement * meChi2Stereo
MonitorElement * meResxMatched
MonitorElement * meResolxrphi
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
MonitorElement * meBunchStereo
MonitorElement * meBunchrphi
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
std::map< std::string, std::vector< uint32_t > > LayerDetMap
MonitorElement * meWclusrphi
Cos< T >::type cos(const T &t)
std::string topFolderName_
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
Abs< T >::type abs(const T &t)
MonitorElement * mePosyMatched
#define DEFINE_FWK_MODULE(type)
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
void createMEs(DQMStore::IBooker &ibooker, const edm::EventSetup &es)
~SiStripRecHitsValid() override
bool getData(T &iHolder) 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
MonitorElement * bookME1D(DQMStore::IBooker &ibooker, const char *ParameterSetLabel, const char *HistoName, const char *HistoTitle)
MonitorElement * meNumTotMatched
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
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
const Plane & surface() const
The nominal surface of the GeomDet.
MonitorElement * meChi2Matched
constexpr uint32_t rawId() const
get the raw id
const GeomDetUnit * stereoDet() const
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > m_geomToken
MonitorElement * meBunchMatched
MonitorElement * meAdcrphi
bool tecIsStereo(const DetId &id) const
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
bool tidIsStereo(const DetId &id) const
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)
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
void addActiveDetectorsRawIds(std::vector< uint32_t > &) 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)