60 detCablingToken_(conf_.getParameter<bool>(
"UseStripCablingDB")
61 ? decltype(detCablingToken_){esConsumes<edm::Transition::BeginRun>()}
77 TrackerGeometry::DetIdContainer::const_iterator
Iditer;
79 for (Iditer = Id.begin(); Iditer != Id.end(); Iditer++) {
80 activeDets.push_back(Iditer->rawId());
160 for (std::vector<uint32_t>::const_iterator Id = activeDets.begin(); Id != activeDets.end(); Id++) {
163 DetId* Iditer = &Iditero;
180 if (!stripdet->isLeaf())
183 float thickness = stripdet->specificSurface().bounds().thickness();
188 detparameters* param =
new detparameters;
191 param->thickness = thickness * 10000;
194 const GlobalPoint globalp = (stripdet->surface()).toGlobal(p);
196 param->magfield = (stripdet->surface()).
toLocal(globalmagdir);
203 unsigned int layerid;
204 getlayer(subid, tTopo, name, layerid);
205 name += TkTag.
label();
210 summaryprofile =
dbe_->
bookProfile(name, name, SUM_bin, TIBRangeMin, TIBRangeMax, 20, 0, 5,
"");
212 summaryprofile =
dbe_->
bookProfile(name, name, SUM_bin, TOBRangeMin, TOBRangeMax, 20, 0, 5,
"");
213 if (summaryprofile) {
214 detparameters* summaryparam =
new detparameters;
217 summaryparam->thickness = thickness * 10000;
218 summaryparam->pitch = topol.
localPitch(p) * 10000;
243 detparmap::iterator detpariter;
244 for (detpariter =
detmap.begin(); detpariter !=
detmap.end(); ++detpariter)
245 delete detpariter->second;
247 delete detpariter->second;
279 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess> hitangleassociation;
280 std::list<SiStripRecHit2D>
cache;
283 trajsize = TrajectoryCollection->size();
286 edm::LogInfo(
"SiStripLAProfileBooker::analyze") <<
" Number of trajectories in event = " <<
trajsize <<
"\n";
290 for (TrajTrackIter = TrajTrackMap->begin(); TrajTrackIter != TrajTrackMap->end();
293 if (TrajTrackIter->key->foundHits() >= 5) {
305 pt = TrajTrackIter->val->pt();
307 chi2norm = TrajTrackIter->val->normalizedChi2();
308 EtaTrack = TrajTrackIter->val->eta();
309 PhiTrack = TrajTrackIter->val->phi();
312 std::vector<TrajectoryMeasurement> TMeas = TrajTrackIter->key->measurements();
313 std::vector<TrajectoryMeasurement>::iterator itm;
315 for (itm = TMeas.begin(); itm != TMeas.end(); itm++) {
318 for (i = 0; i < 100; i++) {
369 cache.push_back(matchedhit->
monoHit());
384 const auto& amplitudes = monocluster->amplitudes();
387 uint16_t FirstStrip = monocluster->firstStrip();
388 auto begin = amplitudes.begin();
390 for (
auto idigi =
begin; idigi != amplitudes.end(); idigi++) {
424 if (monotkdir.
z() != 0) {
426 float tanangle = monotkdir.
x() / monotkdir.
z();
429 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
431 if (TheDet !=
detmap.end())
432 localmagdir = TheDet->second->magfield;
436 float signcorrection = (localmagdir * monoylocal) / (
MagField);
437 if (signcorrection != 0)
441 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
442 hitangleassociation.find(monohit);
444 if (alreadystored != hitangleassociation.end()) {
445 if (itm->estimate() > alreadystored->second.first) {
448 if (itm->estimate() < alreadystored->second.first) {
450 hitangleassociation.insert(std::make_pair(monohit, std::make_pair(itm->estimate(), tanangle)));
453 hitangleassociation.insert(make_pair(monohit, std::make_pair(itm->estimate(), tanangle)));
461 cache.push_back(matchedhit->
stereoHit());
474 ClSize = (stereocluster->amplitudes()).
size();
476 const auto& amplitudes = stereocluster->amplitudes();
478 barycenter = stereocluster->barycenter() - 0.5;
479 uint16_t FirstStrip = stereocluster->firstStrip();
480 auto begin = amplitudes.begin();
482 for (
auto idigi =
begin; idigi != amplitudes.end(); idigi++) {
516 if (stereotkdir.
z() != 0) {
518 float tanangle = stereotkdir.
x() / stereotkdir.
z();
521 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
523 if (TheDet !=
detmap.end())
524 localmagdir = TheDet->second->magfield;
528 float signcorrection = (localmagdir * stereoylocal) / (
MagField);
529 if (signcorrection != 0)
533 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
534 hitangleassociation.find(stereohit);
536 if (alreadystored != hitangleassociation.end()) {
537 if (itm->estimate() > alreadystored->second.first) {
540 if (itm->estimate() < alreadystored->second.first) {
542 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(), tanangle)));
545 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(), tanangle)));
567 const auto& amplitudes = cluster->amplitudes();
570 uint16_t FirstStrip = cluster->firstStrip();
572 auto begin = amplitudes.begin();
573 for (
auto idigi = amplitudes.begin(); idigi != amplitudes.end(); idigi++) {
605 if (trackdirection.
z() != 0) {
607 float tanangle = trackdirection.
x() / trackdirection.
z();
610 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
612 if (TheDet !=
detmap.end())
613 localmagdir = TheDet->second->magfield;
617 float signcorrection = (localmagdir * ylocal) / (
MagField);
618 if (signcorrection != 0)
622 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
623 hitangleassociation.find(hit);
625 if (alreadystored != hitangleassociation.end()) {
626 if (itm->estimate() > alreadystored->second.first) {
629 if (itm->estimate() < alreadystored->second.first) {
631 hitangleassociation.insert(std::make_pair(hit, std::make_pair(itm->estimate(), tanangle)));
634 hitangleassociation.insert(std::make_pair(hit, std::make_pair(itm->estimate(), tanangle)));
644 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator hitsiter;
646 for (hitsiter = hitangleassociation.begin(); hitsiter != hitangleassociation.end(); hitsiter++) {
652 size = (cluster->amplitudes()).
size();
656 float tangent = hitsiter->second.second;
660 detparmap::iterator thedet =
detmap.find(detid.
rawId());
662 if (thedet !=
detmap.end())
663 localmagdir = thedet->second->magfield;
664 float localmagfield = localmagdir.
mag();
666 if (localmagfield != 0.) {
669 float normprojection = (localmagdir * ylocal) / (localmagfield);
671 if (normprojection == 0.)
672 LogDebug(
"SiStripLAProfileBooker::analyze") <<
"Error: YBprojection = 0";
675 float signprojcorrection = 1 / normprojection;
676 tangent *= signprojcorrection;
682 histomap::iterator thehisto =
histos.find(detid.
rawId());
684 if (thehisto ==
histos.end())
686 <<
"Error: the profile associated to" << detid.
rawId() <<
"does not exist! ";
688 thehisto->second->Fill(tangent,
size);
692 unsigned int layerid;
693 getlayer(detid, tTopo, name, layerid);
694 histomap::iterator thesummaryhisto =
summaryhisto.find(layerid);
697 <<
"Error: the profile associated to subdet " << name <<
"does not exist! ";
699 thesummaryhisto->second->Fill(tangent,
size);
708 unsigned int& layerid) {
710 std::stringstream layernum;
713 name +=
"TIB_Layer_";
723 name +=
"TOB_Layer_";
733 name += layernum.str();
EventNumber_t event() const
static constexpr auto TEC
T getUntrackedParameter(std::string const &, T const &) const
const edm::EventSetup & c
unsigned int tibLayer(const DetId &id) const
unsigned int tidRing(const DetId &id) const
const GeomDetUnit * monoDet() const
friend struct const_iterator
virtual const Topology & topology() const
std::vector< unsigned int > tidModuleInfo(const DetId &id) const
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
LocalVector localDirection() const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
unsigned int tecRing(const DetId &id) const
ring id
constexpr uint32_t rawId() const
get the raw id
std::vector< Track > TrackCollection
collection of Tracks
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
const Bounds & bounds() const
unsigned int tidWheel(const DetId &id) const
auto const & tracks
cannot be loose
TrackerGeometry::DetIdContainer::const_iterator Iditer
std::vector< unsigned int > tibStringInfo(const DetId &id) const
const Plane & surface() const
The nominal surface of the GeomDet.
constexpr std::array< uint8_t, layerIndexSize > layer
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
virtual float thickness() const =0
bool getData(T &iHolder) const
virtual float localPitch(const LocalPoint &) const =0
std::vector< unsigned int > tecPetalInfo(const DetId &id) const
std::vector< unsigned int > tobRodInfo(const DetId &id) const
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > detCablingToken_
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
void getlayer(const DetId &detid, const TrackerTopology *tTopo, std::string &name, unsigned int &layerid)
std::vector< uint32_t > activeDets
void analyze(const edm::Event &e, const edm::EventSetup &c) override
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
ClusterRef cluster() const
static constexpr auto TOB
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const TrackerGeomDet * idToDet(DetId) const override
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
SiStripHistoId hidmanager
for(Iditer=Id.begin();Iditer!=Id.end();Iditer++)
SiStripRecHit2D originalHit() const
Log< level::Info, false > LogInfo
unsigned int stereo() const
stereo
void endRun(edm::Run const &, const edm::EventSetup &c) override
static constexpr auto TIB
SiStripRecHit2D stereoHit() const
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
bool operator()(const SiStripRecHit2D *a, const SiStripRecHit2D *b) const
T getParameter(std::string const &) const
SiStripFolderOrganizer folder_organizer
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
std::vector< DetId > DetIdContainer
std::vector< Trajectory > TrajectoryCollection
SiStripRecHit2D monoHit() const
void beginRun(edm::Run const &, const edm::EventSetup &c) override
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
float TanTrackAngleParallel
LocalPoint localPosition() const override
static int position[264][3]
DetId geographicalId() const
SiStripLAProfileBooker(const edm::ParameterSet &conf)
~SiStripLAProfileBooker() override
unsigned int tecWheel(const DetId &id) const
static constexpr auto TID
const TrackerGeometry * tkGeom_
Power< A, B >::type pow(const A &a, const B &b)
const GeomDetUnit * stereoDet() const
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
unsigned int tobLayer(const DetId &id) const
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)