49 return *(
a->cluster()) < *(
b->cluster());
60 detCablingToken_(conf_.getParameter<
bool>(
"UseStripCablingDB")
61 ? decltype(detCablingToken_){esConsumes<edm::Transition::BeginRun>()}
62 : decltype(detCablingToken_){}) {}
71 std::vector<uint32_t> activeDets;
77 TrackerGeometry::DetIdContainer::const_iterator Iditer;
79 for (Iditer = Id.begin(); Iditer != Id.end(); Iditer++) {
80 activeDets.push_back(Iditer->rawId());
102 HitsTree =
new TTree(
"HitsTree",
"HitsTree");
138 TrackTree =
new TTree(
"TrackTree",
"TrackTree");
144 EventTree =
new TTree(
"EventTree",
"EventTree");
160 for (std::vector<uint32_t>::const_iterator Id = activeDets.begin(); Id != activeDets.end(); Id++) {
163 DetId* Iditer = &Iditero;
169 module_bin = TIB_bin;
171 module_bin = TOB_bin;
180 if (!stripdet->isLeaf())
183 float thickness = stripdet->specificSurface().bounds().thickness();
194 const GlobalPoint globalp = (stripdet->surface()).toGlobal(
p);
198 profile->setAxisTitle(
"tan(#theta_{t})", 1);
199 profile->setAxisTitle(
"Cluster size", 2);
203 unsigned int layerid;
213 if (summaryprofile) {
243 detparmap::iterator detpariter;
244 for (detpariter =
detmap.begin(); detpariter !=
detmap.end(); ++detpariter)
245 delete detpariter->second;
247 delete detpariter->second;
274 e.getByLabel(
TkTag, TrajTrackMap);
279 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess> hitangleassociation;
280 std::list<SiStripRecHit2D>
cache;
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();
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++) {
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)));
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;
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();
static constexpr auto TEC
T getParameter(std::string const &) const
unsigned int tobLayer(const DetId &id) const
SiStripRecHit2D stereoHit() const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
std::vector< unsigned int > tidModuleInfo(const DetId &id) const
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
unsigned int stereo() const
stereo
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
virtual const Topology & topology() const
std::vector< unsigned int > tecPetalInfo(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
std::vector< Track > TrackCollection
collection of Tracks
unsigned int tecRing(const DetId &id) const
ring id
ClusterRef cluster() const
const_iterator end() const
last iterator over the map (read only)
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
T getUntrackedParameter(std::string const &, T const &) const
virtual float thickness() const =0
virtual float localPitch(const LocalPoint &) const =0
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)
void analyze(const edm::Event &e, const edm::EventSetup &c) override
LocalVector localDirection() const
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
static constexpr auto TOB
const TrackerGeomDet * idToDet(DetId) const override
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
bool operator()(const SiStripRecHit2D *a, const SiStripRecHit2D *b) const
const GeomDetUnit * monoDet() const
Log< level::Info, false > LogInfo
std::vector< unsigned int > tibStringInfo(const DetId &id) const
void endRun(edm::Run const &, const edm::EventSetup &c) override
static constexpr auto TIB
const Plane & surface() const
The nominal surface of the GeomDet.
DetId geographicalId() const
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
constexpr uint32_t rawId() const
get the raw id
const GeomDetUnit * stereoDet() const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
std::vector< DetId > DetIdContainer
void beginRun(edm::Run const &, const edm::EventSetup &c) override
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
const_iterator begin() const
first iterator over the map (read only)
std::vector< unsigned int > tobRodInfo(const DetId &id) const
SiStripRecHit2D originalHit() const
float TanTrackAngleParallel
LocalPoint localPosition() const override
static int position[264][3]
std::vector< Trajectory > TrajectoryCollection
unsigned int tidRing(const DetId &id) const
SiStripRecHit2D monoHit() const
unsigned int tibLayer(const DetId &id) const
SiStripLAProfileBooker(const edm::ParameterSet &conf)
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
~SiStripLAProfileBooker() override
static constexpr auto TID
const TrackerGeometry * tkGeom_
Power< A, B >::type pow(const A &a, const B &b)
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
const Bounds & bounds() const