30 trackerHitAssociatorConfig_(ps, consumesCollector()),
56 switchNumrphi = ParametersNumrphi.getParameter<
bool>(
"switchon");
86 switchAdcrphi = ParametersAdcrphi.getParameter<
bool>(
"switchon");
89 switchPosxrphi = ParametersPosxrphi.getParameter<
bool>(
"switchon");
95 switchResrphi = ParametersResrphi.getParameter<
bool>(
"switchon");
104 switchChi2rphi = ParametersChi2rphi.getParameter<
bool>(
"switchon");
168 edm::LogInfo(
"SiStripRecHitsValid") <<
"SiStripRecHitsValid::beginRun: " 169 <<
" Creating MEs for new Cabling ";
192 std::map<std::string, int> totnumrechitrphi;
193 std::map<std::string, int> totnumrechitstereo;
194 std::map<std::string, int> totnumrechitmatched;
195 int totrechitrphi = 0;
196 int totrechitstereo = 0;
197 int totrechitmatched = 0;
207 for (
auto const& theDetSet : *rechitsrphi) {
208 DetId detid = theDetSet.detId();
209 uint32_t myid = detid.
rawId();
210 totrechitrphi += theDetSet.size();
213 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(label);
214 std::pair<std::string, int32_t> det_lay_pair = fold_organ.
GetSubDetAndLayer(myid, tTopo,
true);
216 totnumrechitrphi[det_lay_pair.first] = totnumrechitrphi[det_lay_pair.first] + theDetSet.size();
219 for (
auto const& rechit : theDetSet) {
231 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find(det_lay_pair.first);
247 for (
auto const& theDetSet : *rechitsstereo) {
248 DetId detid = theDetSet.detId();
249 uint32_t myid = detid.
rawId();
250 totrechitstereo += theDetSet.size();
253 std::map<std::string, StereoAndMatchedMEs>::iterator iStereoAndMatchedME =
StereoAndMatchedMEsMap.find(label);
254 std::pair<std::string, int32_t> det_lay_pair = fold_organ.
GetSubDetAndLayer(myid, tTopo,
true);
256 totnumrechitstereo[det_lay_pair.first] = totnumrechitstereo[det_lay_pair.first] + theDetSet.size();
259 for (
auto const& rechit : theDetSet) {
271 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find(det_lay_pair.first);
287 for (
auto const& theDetSet : *rechitsmatched) {
288 DetId detid = theDetSet.detId();
289 uint32_t myid = detid.
rawId();
290 totrechitmatched += theDetSet.size();
293 std::map<std::string, StereoAndMatchedMEs>::iterator iStereoAndMatchedME =
StereoAndMatchedMEsMap.find(label);
294 std::pair<std::string, int32_t> det_lay_pair = fold_organ.
GetSubDetAndLayer(myid, tTopo,
true);
296 totnumrechitmatched[det_lay_pair.first] = totnumrechitmatched[det_lay_pair.first] + theDetSet.size();
299 for (
auto const& rechit : theDetSet) {
310 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find(det_lay_pair.first);
325 for (std::vector<std::string>::iterator iSubdet =
SubDetList_.begin(); iSubdet !=
SubDetList_.end(); ++iSubdet) {
326 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find((*iSubdet));
327 fillME(iSubDetME->second.meNumrphi, totnumrechitrphi[(*iSubdet)]);
328 fillME(iSubDetME->second.meNumStereo, totnumrechitstereo[(*iSubdet)]);
329 fillME(iSubDetME->second.meNumMatched, totnumrechitmatched[(*iSubdet)]);
346 LocalPoint localHit = plane.toLocal(globalpos);
353 double scale = -localHit.
z() / dir.
z();
363 return std::pair<LocalPoint, LocalVector>(projectedPos, localStripDir);
380 const auto& amplitudes = (rechit.
cluster())->amplitudes();
382 for (
auto ia : amplitudes) {
400 PSimHit const* closest =
nullptr;
404 if (dist < mindist) {
417 rhparameters[0] = position.
x();
418 rhparameters[1] = position.
y();
424 R[0][0] = error.
xx();
425 R[0][1] = error.
xy();
426 R[1][1] = error.
yy();
429 float est = R.similarity(r);
467 PSimHit const* closest =
nullptr;
468 std::pair<LocalPoint, LocalVector> closestPair;
471 std::pair<LocalPoint, LocalVector> hitPair;
475 if (hitDetId.stereo()) {
480 dist2 = distx * distx + disty * disty;
482 if (dist < mindist) {
484 closestPair = hitPair;
499 rhparameters[0] = position.
x();
500 rhparameters[1] = position.
y();
503 shparameters[0] = sh.
x();
504 shparameters[1] = sh.
y();
507 R[0][0] = error.
xx();
508 R[0][1] = error.
xy();
509 R[1][1] = error.
yy();
512 float est = R.similarity(r);
527 std::vector<uint32_t> activeDets;
538 edm::LogInfo(
"SiStripTkRecHits|SiStripRecHitsValid") <<
"nr. of activeDets: " << activeDets.size();
539 const std::string &tec =
"TEC", tid =
"TID", tob =
"TOB", tib =
"TIB";
540 for (
auto detid_iterator = activeDets.begin(), detid_end = activeDets.end(); detid_iterator != detid_end;
542 uint32_t detid = (*detid_iterator);
545 activeDets.erase(detid_iterator);
550 std::pair<std::string, int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
true);
557 int32_t lnumber = det_layer_pair.second;
559 std::vector<uint32_t> layerDetIds;
563 }
else if (lnumber < 0) {
566 }
else if (lname == tid) {
569 }
else if (lnumber < 0) {
572 }
else if (lname == tob) {
574 }
else if (lname == tib) {
580 folder_organizer.
setLayerFolder(detid, tTopo, det_layer_pair.second,
true);
592 bool isStereo =
false;
594 std::vector<uint32_t> stereoandmatchedDetIds;
595 int32_t stereolnumber = det_layer_pair.second;
596 const std::string& stereolname = det_layer_pair.first;
597 if (stereolname == tec && (tTopo->
tecIsStereo(detid))) {
598 if (stereolnumber > 0) {
600 activeDets, stereoandmatchedDetIds, tTopo, 2, 0, 0, 0,
abs(stereolnumber), 1);
602 }
else if (stereolnumber < 0) {
604 activeDets, stereoandmatchedDetIds, tTopo, 1, 0, 0, 0,
abs(stereolnumber), 1);
607 }
else if (stereolname == tid && (tTopo->
tidIsStereo(detid))) {
608 if (stereolnumber > 0) {
611 }
else if (stereolnumber < 0) {
615 }
else if (stereolname == tob && (tTopo->
tobIsStereo(detid))) {
618 }
else if (stereolname == tib && (tTopo->
tibIsStereo(detid))) {
627 folder_organizer.
setLayerFolder(detid, tTopo, det_layer_pair.second,
true);
676 "Cluster Width - Number of strips that belong to the RecHit cluster");
684 "RecHit Cluster Charge");
700 "RecHit resol(x) coord.");
708 "Residuals of the hit x coordinate");
716 "Pull distribution");
724 "Pull distribution");
740 "No. of assoc. simHits");
775 "Cluster Width - Number of strips that belong to the RecHit cluster");
783 "RecHit Cluster Charge");
800 "RecHit resol(x) coord.");
809 "Residuals of the hit x coordinate");
818 "Pull distribution");
827 "Pull distribution");
845 "No. of assoc. simHits");
872 "RecHit resol(x) coord.");
881 "RecHit resol(y) coord.");
890 "Residuals of the hit x coord.");
899 "Residuals of the hit y coord.");
917 "No. of assoc. simHits");
939 HistoName =
"TH1Numrphi__" +
label;
940 subdetMEs.
meNumrphi =
bookME1D(ibooker,
"TH1Numrphi", HistoName.c_str(),
"Num of RecHits");
945 HistoName =
"TH1Bunchrphi__" +
label;
946 subdetMEs.
meBunchrphi =
bookME1D(ibooker,
"TH1Bunchrphi", HistoName.c_str(),
"Bunch Crossing");
951 HistoName =
"TH1Eventrphi__" +
label;
952 subdetMEs.
meEventrphi =
bookME1D(ibooker,
"TH1Eventrphi", HistoName.c_str(),
"Event (in-time bunch)");
957 HistoName =
"TH1NumStereo__" +
label;
958 subdetMEs.
meNumStereo =
bookME1D(ibooker,
"TH1NumStereo", HistoName.c_str(),
"Num of RecHits in stereo modules");
963 HistoName =
"TH1BunchStereo__" +
label;
969 HistoName =
"TH1EventStereo__" +
label;
970 subdetMEs.
meEventStereo =
bookME1D(ibooker,
"TH1EventStereo", HistoName.c_str(),
"Event (in-time bunch)");
975 HistoName =
"TH1NumMatched__" +
label;
976 subdetMEs.
meNumMatched =
bookME1D(ibooker,
"TH1NumMatched", HistoName.c_str(),
"Num of matched RecHits");
981 HistoName =
"TH1BunchMatched__" +
label;
987 HistoName =
"TH1EventMatched__" +
label;
988 subdetMEs.
meEventMatched =
bookME1D(ibooker,
"TH1EventMatched", HistoName.c_str(),
"Event (in-time bunch)");
996 const char* ParameterSetLabel,
998 const char* HistoTitle) {
1000 return ibooker.
book1D(HistoName,
RecHitProperties rechitpro
MonitorElement * meAdcStereo
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
EventNumber_t event() const
MonitorElement * meEventMatched
std::vector< std::string > SubDetList_
MonitorElement * meEventStereo
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 addActiveDetectorsRawIds(std::vector< uint32_t > &) const
void setSiStripFolderName(std::string name)
LocalError localPositionError() const final
MonitorElement * meNumMatched
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &run, const edm::EventSetup &es) override
std::pair< const std::string, const char * > getSubDetFolderAndTag(const uint32_t &detid, const TrackerTopology *tTopo)
bool tobIsStereo(const DetId &id) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void createSubDetMEs(DQMStore::IBooker &ibooker, std::string label)
TrackerHitAssociator::Config trackerHitAssociatorConfig_
void setCurrentFolder(std::string const &fullpath)
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)
virtual float strip(const LocalPoint &) const =0
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=false)
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
edm::EDGetTokenT< SiStripRecHit2DCollection > stereoRecHitsToken_
MonitorElement * mePosxStereo
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
bool tecIsStereo(const DetId &id) const
MonitorElement * meChi2Stereo
#define DEFINE_FWK_MODULE(type)
MonitorElement * meResxMatched
MonitorElement * meResolxrphi
MonitorElement * meBunchStereo
Local3DPoint localPosition() const
MonitorElement * meBunchrphi
virtual float stripAngle(float strip) const =0
std::map< std::string, std::vector< uint32_t > > LayerDetMap
int bunchCrossing() const
get the detector field from this detid
MonitorElement * meWclusrphi
Cos< T >::type cos(const T &t)
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
std::string topFolderName_
Abs< T >::type abs(const T &t)
MonitorElement * mePosyMatched
ClusterRef cluster() const
void createMEs(DQMStore::IBooker &ibooker, const edm::EventSetup &es)
~SiStripRecHitsValid() override
EncodedEventId eventId() const
edm::EDGetTokenT< SiStripRecHit2DCollection > rphiRecHitsToken_
MonitorElement * meNsimHitStereo
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
LocalVector localDirection() const
Obsolete. Same as momentumAtEntry().unit(), for backward compatibility.
SiStripRecHitsValid(const edm::ParameterSet &conf)
Detector identifier class for the strip tracker.
std::map< std::string, LayerMEs > LayerMEsMap
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
CLHEP::HepVector AlgebraicVector
MonitorElement * meChi2Matched
bool tibIsStereo(const DetId &id) const
MonitorElement * meBunchMatched
MonitorElement * meAdcrphi
MonitorElement * meWclusStereo
MonitorElement * meResyMatched
std::pair< LocalPoint, LocalVector > projectHit(const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
MonitorElement * meResolyMatched
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_
static int position[264][3]
CLHEP::HepSymMatrix AlgebraicSymMatrix
const TrackerGeomDet * idToDet(DetId) const override
void createLayerMEs(DQMStore::IBooker &ibooker, std::string label)
void fillME(MonitorElement *ME, float value1)
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
MonitorElement * meNumStereo
LocalPoint localPosition() const final
MonitorElement * meNsimHitMatched
MonitorElement * meEventrphi
unsigned long long m_cacheID_
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)
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
MonitorElement * mePosxrphi
MonitorElement * meResrphi
std::map< std::string, std::vector< uint32_t > > StereoAndMatchedDetMap
T const * product() const
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)