31 trackerHitAssociatorConfig_(ps, consumesCollector()),
57 switchNumrphi = ParametersNumrphi.getParameter<
bool>(
"switchon");
87 switchAdcrphi = ParametersAdcrphi.getParameter<
bool>(
"switchon");
90 switchPosxrphi = ParametersPosxrphi.getParameter<
bool>(
"switchon");
96 switchResrphi = ParametersResrphi.getParameter<
bool>(
"switchon");
105 switchChi2rphi = ParametersChi2rphi.getParameter<
bool>(
"switchon");
171 edm::LogInfo(
"SiStripRecHitsValid") <<
"SiStripRecHitsValid::beginRun: " 172 <<
" Creating MEs for new Cabling ";
196 std::map<std::string, int > totnumrechitrphi;
197 std::map<std::string, int > totnumrechitstereo;
198 std::map<std::string, int > totnumrechitmatched;
199 int totrechitrphi =0;
200 int totrechitstereo =0;
201 int totrechitmatched =0;
211 for (
auto const& theDetSet : *rechitsrphi) {
212 DetId detid = theDetSet.detId();
213 uint32_t myid = detid.
rawId();
214 totrechitrphi += theDetSet.size();
217 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(label);
218 std::pair<std::string,int32_t> det_lay_pair = fold_organ.
GetSubDetAndLayer(myid,tTopo,
true);
220 totnumrechitrphi[det_lay_pair.first] = totnumrechitrphi[det_lay_pair.first] + theDetSet.size();
223 for(
auto const& rechit : theDetSet){
236 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find(det_lay_pair.first);
251 for (
auto const& theDetSet : *rechitsstereo) {
252 DetId detid = theDetSet.detId();
253 uint32_t myid= detid.
rawId();
254 totrechitstereo += theDetSet.size();
257 std::map<std::string, StereoAndMatchedMEs>::iterator iStereoAndMatchedME =
StereoAndMatchedMEsMap.find(label);
258 std::pair<std::string,int32_t> det_lay_pair = fold_organ.
GetSubDetAndLayer(myid,tTopo,
true);
260 totnumrechitstereo[det_lay_pair.first] = totnumrechitstereo[det_lay_pair.first] + theDetSet.size();
263 for (
auto const& rechit : theDetSet) {
276 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find(det_lay_pair.first);
291 for (
auto const & theDetSet : *rechitsmatched) {
292 DetId detid = theDetSet.detId();
293 uint32_t myid = detid.
rawId();
294 totrechitmatched += theDetSet.size();
297 std::map<std::string, StereoAndMatchedMEs>::iterator iStereoAndMatchedME =
StereoAndMatchedMEsMap.find(label);
298 std::pair<std::string,int32_t> det_lay_pair = fold_organ.
GetSubDetAndLayer(myid,tTopo,
true);
300 totnumrechitmatched[det_lay_pair.first] = totnumrechitmatched[det_lay_pair.first] + theDetSet.size();
303 for (
auto const& rechit : theDetSet) {
314 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find(det_lay_pair.first);
328 for (std::vector<std::string>::iterator iSubdet =
SubDetList_.begin(); iSubdet !=
SubDetList_.end(); ++iSubdet){
329 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find((*iSubdet));
330 fillME(iSubDetME->second.meNumrphi,totnumrechitrphi[(*iSubdet)]);
331 fillME(iSubDetME->second.meNumStereo,totnumrechitstereo[(*iSubdet)]);
332 fillME(iSubDetME->second.meNumMatched,totnumrechitmatched[(*iSubdet)]);
350 LocalPoint localHit = plane.toLocal(globalpos);
357 double scale = -localHit.
z() / dir.
z();
367 return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
379 const auto & amplitudes=(rechit.
cluster())->amplitudes();
381 for(
auto ia : amplitudes){
400 PSimHit const * closest =
nullptr;
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);
462 PSimHit const * closest =
nullptr;
463 std::pair<LocalPoint,LocalVector> closestPair;
466 std::pair<LocalPoint,LocalVector> hitPair;
470 if (hitDetId.stereo()) {
475 dist2 = distx*distx+disty*disty;
479 closestPair = hitPair;
484 if (!closest)
return;
493 rhparameters[0] = position.
x();
494 rhparameters[1] = position.
y();
497 shparameters[0] = sh.
x();
498 shparameters[1] = sh.
y();
501 R[0][0] = error.
xx();
502 R[0][1] = error.
xy();
503 R[1][1] = error.
yy();
506 float est = R.similarity(r);
525 std::vector<uint32_t> activeDets;
536 edm::LogInfo(
"SiStripTkRecHits|SiStripRecHitsValid")<<
"nr. of activeDets: "<<activeDets.size();
537 const std::string& tec =
"TEC", tid =
"TID", tob =
"TOB", tib =
"TIB";
538 for(
auto detid_iterator=activeDets.begin(), detid_end=activeDets.end(); detid_iterator!=detid_end; ++detid_iterator){
539 uint32_t detid = (*detid_iterator);
542 activeDets.erase(detid_iterator);
547 std::pair<std::string,int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid,tTopo,
true);
555 int32_t lnumber = det_layer_pair.second;
557 std::vector<uint32_t> layerDetIds;
561 }
else if (lnumber < 0) {
564 }
else if (lname == tid) {
567 }
else if (lnumber < 0) {
570 }
else if (lname == tob) {
572 }
else if (lname == tib) {
578 folder_organizer.
setLayerFolder(detid,tTopo,det_layer_pair.second,
true);
591 bool isStereo =
false;
593 std::vector<uint32_t> stereoandmatchedDetIds;
594 int32_t stereolnumber = det_layer_pair.second;
595 const std::string& stereolname = det_layer_pair.first;
596 if ( stereolname == tec && (tTopo->
tecIsStereo(detid)) ) {
597 if ( stereolnumber > 0 ) {
600 }
else if ( stereolnumber < 0 ) {
604 }
else if ( stereolname == tid && (tTopo->
tidIsStereo(detid)) ) {
605 if ( stereolnumber > 0 ) {
608 }
else if ( stereolnumber < 0 ) {
612 }
else if ( stereolname == tob && (tTopo->
tobIsStereo(detid)) ) {
615 }
else if ( stereolname == tib && (tTopo->
tibIsStereo(detid)) ) {
624 folder_organizer.
setLayerFolder(detid,tTopo,det_layer_pair.second,
true);
673 layerMEs.
meWclusrphi =
bookME1D(ibooker,
"TH1Wclusrphi", hidmanager.
createHistoLayer(
"Wclus_rphi",
"layer",label,
"").c_str() ,
"Cluster Width - Number of strips that belong to the RecHit cluster");
746 stereoandmatchedMEs.
meWclusStereo =
bookME1D(ibooker,
"TH1WclusStereo", hidmanager.
createHistoLayer(
"Wclus_stereo",
"layer",label,
"").c_str() ,
"Cluster Width - Number of strips that belong to the RecHit cluster");
766 stereoandmatchedMEs.
meResStereo =
bookME1D(ibooker,
"TH1ResStereo", hidmanager.
createHistoLayer(
"Res_stereo",
"layer",label,
"").c_str() ,
"Residuals of the hit x coordinate");
850 HistoName =
"TH1Numrphi__" +
label;
851 subdetMEs.
meNumrphi =
bookME1D(ibooker,
"TH1Numrphi",HistoName.c_str(),
"Num of RecHits");
856 HistoName =
"TH1Bunchrphi__" +
label;
857 subdetMEs.
meBunchrphi =
bookME1D(ibooker,
"TH1Bunchrphi",HistoName.c_str(),
"Bunch Crossing");
862 HistoName =
"TH1Eventrphi__" +
label;
863 subdetMEs.
meEventrphi =
bookME1D(ibooker,
"TH1Eventrphi",HistoName.c_str(),
"Event (in-time bunch)");
868 HistoName =
"TH1NumStereo__" +
label;
869 subdetMEs.
meNumStereo =
bookME1D(ibooker,
"TH1NumStereo",HistoName.c_str(),
"Num of RecHits in stereo modules");
874 HistoName =
"TH1BunchStereo__" +
label;
880 HistoName =
"TH1EventStereo__" +
label;
881 subdetMEs.
meEventStereo =
bookME1D(ibooker,
"TH1EventStereo",HistoName.c_str(),
"Event (in-time bunch)");
886 HistoName =
"TH1NumMatched__" +
label;
887 subdetMEs.
meNumMatched =
bookME1D(ibooker,
"TH1NumMatched",HistoName.c_str(),
"Num of matched RecHits" );
892 HistoName =
"TH1BunchMatched__" +
label;
898 HistoName =
"TH1EventMatched__" +
label;
909 return ibooker.
book1D(HistoName,HistoTitle,
RecHitProperties rechitpro
MonitorElement * meAdcStereo
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
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
std::map< std::string, std::vector< uint32_t > > LayerDetMap
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)
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
MonitorElement * meResxMatched
MonitorElement * meResolxrphi
MonitorElement * meBunchStereo
Local3DPoint localPosition() const
MonitorElement * meBunchrphi
virtual float stripAngle(float strip) const =0
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_
MonitorElement * book1D(Args &&...args)
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 * meNumTotMatched
MonitorElement * bookME1D(DQMStore::IBooker &ibooker, const char *ParameterSetLabel, const char *HistoName, const char *HistoTitle)
LocalVector localDirection() const
Obsolete. Same as momentumAtEntry().unit(), for backward compatibility.
SiStripRecHitsValid(const edm::ParameterSet &conf)
Detector identifier class for the strip tracker.
const Topology & topology() const override
Returns a reference to the strip proxy topology.
std::map< std::string, LayerMEs > LayerMEsMap
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
CLHEP::HepVector AlgebraicVector
MonitorElement * meChi2Matched
void setCurrentFolder(const std::string &fullpath)
std::map< std::string, std::vector< uint32_t > > StereoAndMatchedDetMap
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
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
T const * product() const
MonitorElement * mePullMFrphi
MonitorElement * meNumrphi
const GeomDetUnit * stereoDet() const
MonitorElement * meNumTotrphi