79 std::vector<uint32_t> activeDets;
87 TrackerGeometry::DetIdContainer::const_iterator Iditer;
89 for (Iditer = Id.begin(); Iditer != Id.end(); Iditer++) {
90 activeDets.push_back(Iditer->rawId());
108 Hit_Tree = hFile->mkdir(
"Hit_Tree");
112 HitsTree =
new TTree(
"HitsTree",
"HitsTree");
148 TrackTree =
new TTree(
"TrackTree",
"TrackTree");
154 EventTree =
new TTree(
"EventTree",
"EventTree");
170 for (std::vector<uint32_t>::const_iterator Id = activeDets.begin(); Id != activeDets.end(); Id++) {
173 DetId* Iditer = &Iditero;
179 module_bin = TIB_bin;
181 module_bin = TOB_bin;
190 if (!stripdet->isLeaf())
193 float thickness = stripdet->specificSurface().bounds().thickness();
204 const GlobalPoint globalp = (stripdet->surface()).toGlobal(p);
213 unsigned int layerid;
214 getlayer(subid, tTopo, name, layerid);
215 name += TkTag.
label();
220 summaryprofile =
dbe_->
bookProfile(name, name, SUM_bin, TIBRangeMin, TIBRangeMax, 20, 0, 5,
"");
222 summaryprofile =
dbe_->
bookProfile(name, name, SUM_bin, TOBRangeMin, TOBRangeMax, 20, 0, 5,
"");
223 if (summaryprofile) {
227 summaryparam->
thickness = thickness * 10000;
251 detparmap::iterator detpariter;
252 for (detpariter =
detmap.begin(); detpariter !=
detmap.end(); ++detpariter)
253 delete detpariter->second;
255 delete detpariter->second;
290 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess> hitangleassociation;
291 std::list<SiStripRecHit2D>
cache;
294 trajsize = TrajectoryCollection->size();
297 edm::LogInfo(
"SiStripLAProfileBooker::analyze") <<
" Number of trajectories in event = " <<
trajsize <<
"\n";
301 for (TrajTrackIter = TrajTrackMap->
begin(); TrajTrackIter != TrajTrackMap->
end();
304 if (TrajTrackIter->key->foundHits() >= 5) {
316 pt = TrajTrackIter->val->pt();
318 chi2norm = TrajTrackIter->val->normalizedChi2();
319 EtaTrack = TrajTrackIter->val->eta();
320 PhiTrack = TrajTrackIter->val->phi();
323 std::vector<TrajectoryMeasurement> TMeas = TrajTrackIter->key->measurements();
324 std::vector<TrajectoryMeasurement>::iterator itm;
326 for (itm = TMeas.begin(); itm != TMeas.end(); itm++) {
329 for (i = 0; i < 100; i++) {
380 cache.push_back(matchedhit->
monoHit());
395 const auto& amplitudes = monocluster->amplitudes();
398 uint16_t FirstStrip = monocluster->firstStrip();
399 auto begin = amplitudes.begin();
401 for (
auto idigi =
begin; idigi != amplitudes.end(); idigi++) {
435 if (monotkdir.
z() != 0) {
437 float tanangle = monotkdir.
x() / monotkdir.
z();
440 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
442 if (TheDet !=
detmap.end())
443 localmagdir = TheDet->second->magfield;
447 float signcorrection = (localmagdir * monoylocal) / (
MagField);
448 if (signcorrection != 0)
452 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
453 hitangleassociation.find(monohit);
455 if (alreadystored != hitangleassociation.end()) {
456 if (itm->estimate() > alreadystored->second.first) {
459 if (itm->estimate() < alreadystored->second.first) {
461 hitangleassociation.insert(std::make_pair(monohit, std::make_pair(itm->estimate(), tanangle)));
464 hitangleassociation.insert(make_pair(monohit, std::make_pair(itm->estimate(), tanangle)));
472 cache.push_back(matchedhit->
stereoHit());
485 ClSize = (stereocluster->amplitudes()).
size();
487 const auto& amplitudes = stereocluster->amplitudes();
489 barycenter = stereocluster->barycenter() - 0.5;
490 uint16_t FirstStrip = stereocluster->firstStrip();
491 auto begin = amplitudes.begin();
493 for (
auto idigi =
begin; idigi != amplitudes.end(); idigi++) {
527 if (stereotkdir.
z() != 0) {
529 float tanangle = stereotkdir.
x() / stereotkdir.
z();
532 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
534 if (TheDet !=
detmap.end())
535 localmagdir = TheDet->second->magfield;
539 float signcorrection = (localmagdir * stereoylocal) / (
MagField);
540 if (signcorrection != 0)
544 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
545 hitangleassociation.find(stereohit);
547 if (alreadystored != hitangleassociation.end()) {
548 if (itm->estimate() > alreadystored->second.first) {
551 if (itm->estimate() < alreadystored->second.first) {
553 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(), tanangle)));
556 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(), tanangle)));
578 const auto& amplitudes = cluster->amplitudes();
581 uint16_t FirstStrip = cluster->firstStrip();
583 auto begin = amplitudes.begin();
584 for (
auto idigi = amplitudes.begin(); idigi != amplitudes.end(); idigi++) {
616 if (trackdirection.
z() != 0) {
618 float tanangle = trackdirection.
x() / trackdirection.
z();
621 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
623 if (TheDet !=
detmap.end())
624 localmagdir = TheDet->second->magfield;
628 float signcorrection = (localmagdir * ylocal) / (
MagField);
629 if (signcorrection != 0)
633 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
634 hitangleassociation.find(hit);
636 if (alreadystored != hitangleassociation.end()) {
637 if (itm->estimate() > alreadystored->second.first) {
640 if (itm->estimate() < alreadystored->second.first) {
642 hitangleassociation.insert(std::make_pair(hit, std::make_pair(itm->estimate(), tanangle)));
645 hitangleassociation.insert(std::make_pair(hit, std::make_pair(itm->estimate(), tanangle)));
655 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator hitsiter;
657 for (hitsiter = hitangleassociation.begin(); hitsiter != hitangleassociation.end(); hitsiter++) {
663 size = (cluster->amplitudes()).
size();
667 float tangent = hitsiter->second.second;
671 detparmap::iterator thedet =
detmap.find(detid.
rawId());
673 if (thedet !=
detmap.end())
674 localmagdir = thedet->second->magfield;
675 float localmagfield = localmagdir.
mag();
677 if (localmagfield != 0.) {
680 float normprojection = (localmagdir * ylocal) / (localmagfield);
682 if (normprojection == 0.)
683 LogDebug(
"SiStripLAProfileBooker::analyze") <<
"Error: YBprojection = 0";
686 float signprojcorrection = 1 / normprojection;
687 tangent *= signprojcorrection;
693 histomap::iterator thehisto =
histos.find(detid.
rawId());
695 if (thehisto ==
histos.end())
697 <<
"Error: the profile associated to" << detid.
rawId() <<
"does not exist! ";
699 thehisto->second->Fill(tangent,
size);
703 unsigned int layerid;
704 getlayer(detid, tTopo, name, layerid);
705 histomap::iterator thesummaryhisto =
summaryhisto.find(layerid);
708 <<
"Error: the profile associated to subdet " << name <<
"does not exist! ";
710 thesummaryhisto->second->Fill(tangent,
size);
719 unsigned int& layerid) {
721 std::stringstream layernum;
724 name +=
"TIB_Layer_";
734 name +=
"TOB_Layer_";
744 name += layernum.str();
745 layerid = detid.
subdetId() * 10 + layer;
T getParameter(std::string const &) const
EventNumber_t event() const
static constexpr auto TEC
T getUntrackedParameter(std::string const &, T const &) const
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
unsigned int tibLayer(const DetId &id) const
unsigned int tidRing(const DetId &id) const
const GeomDetUnit * monoDet() const
friend struct const_iterator
const_iterator end() const
last iterator over the map (read only)
virtual const Topology & topology() const
std::vector< unsigned int > tidModuleInfo(const DetId &id) const
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
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
std::vector< unsigned int > tibStringInfo(const DetId &id) const
const Plane & surface() const
The nominal surface of the GeomDet.
MonitorElement * bookProfile(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
std::vector< unsigned int > tecPetalInfo(const DetId &id) const
std::vector< unsigned int > tobRodInfo(const DetId &id) const
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
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
ClusterRef cluster() const
static constexpr auto TOB
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
SiStripRecHit2D originalHit() const
unsigned int stereo() const
stereo
static constexpr auto TIB
SiStripRecHit2D stereoHit() const
virtual float thickness() const =0
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
bool operator()(const SiStripRecHit2D *a, const SiStripRecHit2D *b) const
virtual float localPitch(const LocalPoint &) const =0
std::vector< DetId > DetIdContainer
std::vector< Trajectory > TrajectoryCollection
SiStripRecHit2D monoHit() const
void beginRun(edm::Run const &, const edm::EventSetup &c) override
float TanTrackAngleParallel
static int position[264][3]
const TrackerGeomDet * idToDet(DetId) const override
LocalPoint localPosition() const final
const_iterator begin() const
first iterator over the map (read only)
DetId geographicalId() const
SiStripLAProfileBooker(const edm::ParameterSet &conf)
~SiStripLAProfileBooker() override
unsigned int tecWheel(const DetId &id) const
static constexpr auto TID
T const * product() const
Power< A, B >::type pow(const A &a, const B &b)
void save(std::string const &filename, std::string const &path="", std::string const &pattern="", std::string const &rewrite="", uint32_t run=0, uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, std::string const &fileupdate="RECREATE")
const GeomDetUnit * stereoDet() const
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
unsigned int tobLayer(const DetId &id) const
const TrackerGeometry * tracker
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)