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 ";
199 std::map<std::string, int > totnumrechitrphi;
200 std::map<std::string, int > totnumrechitstereo;
201 std::map<std::string, int > totnumrechitmatched;
202 int totrechitrphi =0;
203 int totrechitstereo =0;
204 int totrechitmatched =0;
214 for (
auto const& theDetSet : *rechitsrphi) {
215 DetId detid = theDetSet.detId();
216 uint32_t myid = detid.
rawId();
217 totrechitrphi += theDetSet.size();
220 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(label);
221 std::pair<std::string,int32_t> det_lay_pair = fold_organ.
GetSubDetAndLayer(myid,tTopo,
true);
223 totnumrechitrphi[det_lay_pair.first] = totnumrechitrphi[det_lay_pair.first] + theDetSet.size();
226 for(
auto const& rechit : theDetSet){
239 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find(det_lay_pair.first);
254 for (
auto const& theDetSet : *rechitsstereo) {
255 DetId detid = theDetSet.detId();
256 uint32_t myid= detid.
rawId();
257 totrechitstereo += theDetSet.size();
260 std::map<std::string, StereoAndMatchedMEs>::iterator iStereoAndMatchedME =
StereoAndMatchedMEsMap.find(label);
261 std::pair<std::string,int32_t> det_lay_pair = fold_organ.
GetSubDetAndLayer(myid,tTopo,
true);
263 totnumrechitstereo[det_lay_pair.first] = totnumrechitstereo[det_lay_pair.first] + theDetSet.size();
266 for (
auto const& rechit : theDetSet) {
279 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find(det_lay_pair.first);
294 for (
auto const & theDetSet : *rechitsmatched) {
295 DetId detid = theDetSet.detId();
296 uint32_t myid = detid.
rawId();
297 totrechitmatched += theDetSet.size();
300 std::map<std::string, StereoAndMatchedMEs>::iterator iStereoAndMatchedME =
StereoAndMatchedMEsMap.find(label);
301 std::pair<std::string,int32_t> det_lay_pair = fold_organ.
GetSubDetAndLayer(myid,tTopo,
true);
303 totnumrechitmatched[det_lay_pair.first] = totnumrechitmatched[det_lay_pair.first] + theDetSet.size();
306 for (
auto const& rechit : theDetSet) {
317 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find(det_lay_pair.first);
331 for (std::vector<std::string>::iterator iSubdet =
SubDetList_.begin(); iSubdet !=
SubDetList_.end(); ++iSubdet){
332 std::map<std::string, SubDetMEs>::iterator iSubDetME =
SubDetMEsMap.find((*iSubdet));
333 fillME(iSubDetME->second.meNumrphi,totnumrechitrphi[(*iSubdet)]);
334 fillME(iSubDetME->second.meNumStereo,totnumrechitstereo[(*iSubdet)]);
335 fillME(iSubDetME->second.meNumMatched,totnumrechitmatched[(*iSubdet)]);
353 LocalPoint localHit = plane.toLocal(globalpos);
360 double scale = -localHit.
z() / dir.
z();
370 return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
382 const auto & amplitudes=(rechit.
cluster())->amplitudes();
384 for(
auto ia : amplitudes){
403 PSimHit const * closest =
nullptr;
420 rhparameters[0] = position.
x();
421 rhparameters[1] = position.
y();
427 R[0][0] = error.
xx();
428 R[0][1] = error.
xy();
429 R[1][1] = error.
yy();
432 float est = R.similarity(r);
465 PSimHit const * closest =
nullptr;
466 std::pair<LocalPoint,LocalVector> closestPair;
469 std::pair<LocalPoint,LocalVector> hitPair;
473 if (hitDetId.stereo()) {
478 dist2 = distx*distx+disty*disty;
482 closestPair = hitPair;
487 if (!closest)
return;
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);
528 std::vector<uint32_t> activeDets;
541 edm::LogInfo(
"SiStripTkRecHits|SiStripRecHitsValid")<<
"nr. of activeDets: "<<activeDets.size();
542 const std::string& tec =
"TEC", tid =
"TID", tob =
"TOB", tib =
"TIB";
543 for(
auto detid_iterator=activeDets.begin(), detid_end=activeDets.end(); detid_iterator!=detid_end; ++detid_iterator){
544 uint32_t detid = (*detid_iterator);
547 activeDets.erase(detid_iterator);
552 std::pair<std::string,int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid,tTopo,
true);
560 int32_t lnumber = det_layer_pair.second;
562 std::vector<uint32_t> layerDetIds;
566 }
else if (lnumber < 0) {
569 }
else if (lname == tid) {
572 }
else if (lnumber < 0) {
575 }
else if (lname == tob) {
577 }
else if (lname == tib) {
583 folder_organizer.
setLayerFolder(detid,tTopo,det_layer_pair.second,
true);
596 bool isStereo =
false;
598 std::vector<uint32_t> stereoandmatchedDetIds;
599 int32_t stereolnumber = det_layer_pair.second;
600 const std::string& stereolname = det_layer_pair.first;
601 if ( stereolname == tec && (tTopo->
tecIsStereo(detid)) ) {
602 if ( stereolnumber > 0 ) {
603 substructure.
getTECDetectors(activeDets,stereoandmatchedDetIds,2,0,0,0,
abs(stereolnumber),1);
605 }
else if ( stereolnumber < 0 ) {
606 substructure.
getTECDetectors(activeDets,stereoandmatchedDetIds,1,0,0,0,
abs(stereolnumber),1);
609 }
else if ( stereolname == tid && (tTopo->
tidIsStereo(detid)) ) {
610 if ( stereolnumber > 0 ) {
611 substructure.
getTIDDetectors(activeDets,stereoandmatchedDetIds,2,0,
abs(stereolnumber),1);
613 }
else if ( stereolnumber < 0 ) {
614 substructure.
getTIDDetectors(activeDets,stereoandmatchedDetIds,1,0,
abs(stereolnumber),1);
617 }
else if ( stereolname == tob && (tTopo->
tobIsStereo(detid)) ) {
618 substructure.
getTOBDetectors(activeDets,stereoandmatchedDetIds,stereolnumber,0,0);
620 }
else if ( stereolname == tib && (tTopo->
tibIsStereo(detid)) ) {
621 substructure.
getTIBDetectors(activeDets,stereoandmatchedDetIds,stereolnumber,0,0,0);
629 folder_organizer.
setLayerFolder(detid,tTopo,det_layer_pair.second,
true);
678 layerMEs.
meWclusrphi =
bookME1D(ibooker,
"TH1Wclusrphi", hidmanager.
createHistoLayer(
"Wclus_rphi",
"layer",label,
"").c_str() ,
"Cluster Width - Number of strips that belong to the RecHit cluster");
751 stereoandmatchedMEs.
meWclusStereo =
bookME1D(ibooker,
"TH1WclusStereo", hidmanager.
createHistoLayer(
"Wclus_stereo",
"layer",label,
"").c_str() ,
"Cluster Width - Number of strips that belong to the RecHit cluster");
771 stereoandmatchedMEs.
meResStereo =
bookME1D(ibooker,
"TH1ResStereo", hidmanager.
createHistoLayer(
"Res_stereo",
"layer",label,
"").c_str() ,
"Residuals of the hit x coordinate");
855 HistoName =
"TH1Numrphi__" +
label;
856 subdetMEs.
meNumrphi =
bookME1D(ibooker,
"TH1Numrphi",HistoName.c_str(),
"Num of RecHits");
861 HistoName =
"TH1Bunchrphi__" +
label;
862 subdetMEs.
meBunchrphi =
bookME1D(ibooker,
"TH1Bunchrphi",HistoName.c_str(),
"Bunch Crossing");
867 HistoName =
"TH1Eventrphi__" +
label;
868 subdetMEs.
meEventrphi =
bookME1D(ibooker,
"TH1Eventrphi",HistoName.c_str(),
"Event (in-time bunch)");
873 HistoName =
"TH1NumStereo__" +
label;
874 subdetMEs.
meNumStereo =
bookME1D(ibooker,
"TH1NumStereo",HistoName.c_str(),
"Num of RecHits in stereo modules");
879 HistoName =
"TH1BunchStereo__" +
label;
885 HistoName =
"TH1EventStereo__" +
label;
886 subdetMEs.
meEventStereo =
bookME1D(ibooker,
"TH1EventStereo",HistoName.c_str(),
"Event (in-time bunch)");
891 HistoName =
"TH1NumMatched__" +
label;
892 subdetMEs.
meNumMatched =
bookME1D(ibooker,
"TH1NumMatched",HistoName.c_str(),
"Num of matched RecHits" );
897 HistoName =
"TH1BunchMatched__" +
label;
903 HistoName =
"TH1EventMatched__" +
label;
914 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 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)
MonitorElement * mePullLFStereo
std::map< std::string, StereoAndMatchedMEs > StereoAndMatchedMEsMap
virtual float strip(const LocalPoint &) const =0
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=false)
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_
uint32_t rawId() const
get the raw id
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
void getTOBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tobDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t rod=0) const
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 getTECDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tecDetRawIds, 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) const
void createTotalMEs(DQMStore::IBooker &ibooker)
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > matchedRecHitsToken_
static int position[264][3]
void beginJob(const edm::EventSetup &es)
void getTIBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tibDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t int_ext=0, uint32_t string=0) const
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
void getTIDDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tidDetRawIds, uint32_t side=0, uint32_t wheel=0, uint32_t ring=0, uint32_t ster=0) const
MonitorElement * meEventrphi
unsigned long long m_cacheID_
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