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){
235 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find(det_lay_pair.first);
250 for (
auto const& theDetSet : *rechitsstereo) {
251 DetId detid = theDetSet.detId();
252 uint32_t myid= detid.
rawId();
253 totrechitstereo += theDetSet.size();
256 std::map<std::string, StereoAndMatchedMEs>::iterator iStereoAndMatchedME =
StereoAndMatchedMEsMap.find(label);
257 std::pair<std::string,int32_t> det_lay_pair = fold_organ.
GetSubDetAndLayer(myid,tTopo,
true);
259 totnumrechitstereo[det_lay_pair.first] = totnumrechitstereo[det_lay_pair.first] + theDetSet.size();
262 for (
auto const& rechit : theDetSet) {
274 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find(det_lay_pair.first);
289 for (
auto const & theDetSet : *rechitsmatched) {
290 DetId detid = theDetSet.detId();
291 uint32_t myid = detid.
rawId();
292 totrechitmatched += theDetSet.size();
295 std::map<std::string, StereoAndMatchedMEs>::iterator iStereoAndMatchedME =
StereoAndMatchedMEsMap.find(label);
296 std::pair<std::string,int32_t> det_lay_pair = fold_organ.
GetSubDetAndLayer(myid,tTopo,
true);
298 totnumrechitmatched[det_lay_pair.first] = totnumrechitmatched[det_lay_pair.first] + theDetSet.size();
301 for (
auto const& rechit : theDetSet) {
312 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find(det_lay_pair.first);
326 for (std::vector<std::string>::iterator iSubdet =
SubDetList_.begin(); iSubdet !=
SubDetList_.end(); ++iSubdet){
327 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find((*iSubdet));
328 fillME(iSubDetME->second.meNumrphi,totnumrechitrphi[(*iSubdet)]);
329 fillME(iSubDetME->second.meNumStereo,totnumrechitstereo[(*iSubdet)]);
330 fillME(iSubDetME->second.meNumMatched,totnumrechitmatched[(*iSubdet)]);
348 LocalPoint localHit = plane.toLocal(globalpos);
355 double scale = -localHit.
z() / dir.
z();
365 return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
377 const auto & amplitudes=(rechit.
cluster())->amplitudes();
379 for(
auto ia : amplitudes){
398 PSimHit const * closest =
nullptr;
415 rhparameters[0] = position.
x();
416 rhparameters[1] = position.
y();
422 R[0][0] = error.
xx();
423 R[0][1] = error.
xy();
424 R[1][1] = error.
yy();
427 float est = R.similarity(r);
460 PSimHit const * closest =
nullptr;
461 std::pair<LocalPoint,LocalVector> closestPair;
464 std::pair<LocalPoint,LocalVector> hitPair;
468 if (hitDetId.stereo()) {
473 dist2 = distx*distx+disty*disty;
477 closestPair = hitPair;
482 if (!closest)
return;
491 rhparameters[0] = position.
x();
492 rhparameters[1] = position.
y();
495 shparameters[0] = sh.
x();
496 shparameters[1] = sh.
y();
499 R[0][0] = error.
xx();
500 R[0][1] = error.
xy();
501 R[1][1] = error.
yy();
504 float est = R.similarity(r);
523 std::vector<uint32_t> activeDets;
534 edm::LogInfo(
"SiStripTkRecHits|SiStripRecHitsValid")<<
"nr. of activeDets: "<<activeDets.size();
535 const std::string& tec =
"TEC", tid =
"TID", tob =
"TOB", tib =
"TIB";
536 for(
auto detid_iterator=activeDets.begin(), detid_end=activeDets.end(); detid_iterator!=detid_end; ++detid_iterator){
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);
553 int32_t lnumber = det_layer_pair.second;
555 std::vector<uint32_t> layerDetIds;
559 }
else if (lnumber < 0) {
562 }
else if (lname == tid) {
565 }
else if (lnumber < 0) {
568 }
else if (lname == tob) {
570 }
else if (lname == tib) {
576 folder_organizer.
setLayerFolder(detid,tTopo,det_layer_pair.second,
true);
589 bool isStereo =
false;
591 std::vector<uint32_t> stereoandmatchedDetIds;
592 int32_t stereolnumber = det_layer_pair.second;
593 const std::string& stereolname = det_layer_pair.first;
594 if ( stereolname == tec && (tTopo->
tecIsStereo(detid)) ) {
595 if ( stereolnumber > 0 ) {
598 }
else if ( stereolnumber < 0 ) {
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 layerMEs.
meWclusrphi =
bookME1D(ibooker,
"TH1Wclusrphi", hidmanager.
createHistoLayer(
"Wclus_rphi",
"layer",label,
"").c_str() ,
"Cluster Width - Number of strips that belong to the RecHit cluster");
744 stereoandmatchedMEs.
meWclusStereo =
bookME1D(ibooker,
"TH1WclusStereo", hidmanager.
createHistoLayer(
"Wclus_stereo",
"layer",label,
"").c_str() ,
"Cluster Width - Number of strips that belong to the RecHit cluster");
764 stereoandmatchedMEs.
meResStereo =
bookME1D(ibooker,
"TH1ResStereo", hidmanager.
createHistoLayer(
"Res_stereo",
"layer",label,
"").c_str() ,
"Residuals of the hit x coordinate");
848 HistoName =
"TH1Numrphi__" +
label;
849 subdetMEs.
meNumrphi =
bookME1D(ibooker,
"TH1Numrphi",HistoName.c_str(),
"Num of RecHits");
854 HistoName =
"TH1Bunchrphi__" +
label;
855 subdetMEs.
meBunchrphi =
bookME1D(ibooker,
"TH1Bunchrphi",HistoName.c_str(),
"Bunch Crossing");
860 HistoName =
"TH1Eventrphi__" +
label;
861 subdetMEs.
meEventrphi =
bookME1D(ibooker,
"TH1Eventrphi",HistoName.c_str(),
"Event (in-time bunch)");
866 HistoName =
"TH1NumStereo__" +
label;
867 subdetMEs.
meNumStereo =
bookME1D(ibooker,
"TH1NumStereo",HistoName.c_str(),
"Num of RecHits in stereo modules");
872 HistoName =
"TH1BunchStereo__" +
label;
878 HistoName =
"TH1EventStereo__" +
label;
879 subdetMEs.
meEventStereo =
bookME1D(ibooker,
"TH1EventStereo",HistoName.c_str(),
"Event (in-time bunch)");
884 HistoName =
"TH1NumMatched__" +
label;
885 subdetMEs.
meNumMatched =
bookME1D(ibooker,
"TH1NumMatched",HistoName.c_str(),
"Num of matched RecHits" );
890 HistoName =
"TH1BunchMatched__" +
label;
896 HistoName =
"TH1EventMatched__" +
label;
907 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_
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
void setCurrentFolder(std::string const &fullpath)
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.
std::map< std::string, LayerMEs > LayerMEsMap
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
CLHEP::HepVector AlgebraicVector
MonitorElement * meChi2Matched
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