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) {
241 detparmap::iterator detpariter;
242 for (detpariter =
detmap.begin(); detpariter !=
detmap.end(); ++detpariter)
243 delete detpariter->second;
245 delete detpariter->second;
272 e.getByLabel(TkTag, TrajTrackMap);
277 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess> hitangleassociation;
278 std::list<SiStripRecHit2D>
cache;
284 edm::LogInfo(
"SiStripLAProfileBooker::analyze") <<
" Number of trajectories in event = " <<
trajsize <<
"\n";
288 for (TrajTrackIter = TrajTrackMap->
begin(); TrajTrackIter != TrajTrackMap->
end();
291 if (TrajTrackIter->key->foundHits() >= 5) {
303 pt = TrajTrackIter->val->pt();
305 chi2norm = TrajTrackIter->val->normalizedChi2();
306 EtaTrack = TrajTrackIter->val->eta();
307 PhiTrack = TrajTrackIter->val->phi();
310 std::vector<TrajectoryMeasurement> TMeas = TrajTrackIter->key->measurements();
311 std::vector<TrajectoryMeasurement>::iterator itm;
313 for (itm = TMeas.begin(); itm != TMeas.end(); itm++) {
316 for (
i = 0;
i < 100;
i++) {
352 lhit = phit->originalHit();
382 const auto& amplitudes = monocluster->amplitudes();
385 uint16_t FirstStrip = monocluster->firstStrip();
386 auto begin = amplitudes.begin();
388 for (
auto idigi = begin; idigi != amplitudes.end(); idigi++) {
422 if (monotkdir.
z() != 0) {
424 float tanangle = monotkdir.
x() / monotkdir.
z();
427 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
429 if (TheDet !=
detmap.end())
430 localmagdir = TheDet->second->magfield;
434 float signcorrection = (localmagdir * monoylocal) / (
MagField);
435 if (signcorrection != 0)
439 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
440 hitangleassociation.find(monohit);
442 if (alreadystored != hitangleassociation.end()) {
443 if (itm->estimate() > alreadystored->second.first) {
446 if (itm->estimate() < alreadystored->second.first) {
448 hitangleassociation.insert(std::make_pair(monohit, std::make_pair(itm->estimate(), tanangle)));
451 hitangleassociation.insert(make_pair(monohit, std::make_pair(itm->estimate(), tanangle)));
472 ClSize = (stereocluster->amplitudes()).
size();
474 const auto& amplitudes = stereocluster->amplitudes();
476 barycenter = stereocluster->barycenter() - 0.5;
477 uint16_t FirstStrip = stereocluster->firstStrip();
478 auto begin = amplitudes.begin();
480 for (
auto idigi = begin; idigi != amplitudes.end(); idigi++) {
514 if (stereotkdir.
z() != 0) {
516 float tanangle = stereotkdir.
x() / stereotkdir.
z();
519 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
521 if (TheDet !=
detmap.end())
522 localmagdir = TheDet->second->magfield;
526 float signcorrection = (localmagdir * stereoylocal) / (
MagField);
527 if (signcorrection != 0)
531 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
532 hitangleassociation.find(stereohit);
534 if (alreadystored != hitangleassociation.end()) {
535 if (itm->estimate() > alreadystored->second.first) {
538 if (itm->estimate() < alreadystored->second.first) {
540 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(), tanangle)));
543 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(), tanangle)));
565 const auto& amplitudes = cluster->amplitudes();
568 uint16_t FirstStrip = cluster->firstStrip();
570 auto begin = amplitudes.begin();
571 for (
auto idigi = amplitudes.begin(); idigi != amplitudes.end(); idigi++) {
603 if (trackdirection.
z() != 0) {
605 float tanangle = trackdirection.
x() / trackdirection.
z();
608 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
610 if (TheDet !=
detmap.end())
611 localmagdir = TheDet->second->magfield;
615 float signcorrection = (localmagdir * ylocal) / (
MagField);
616 if (signcorrection != 0)
620 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
621 hitangleassociation.find(
hit);
623 if (alreadystored != hitangleassociation.end()) {
624 if (itm->estimate() > alreadystored->second.first) {
627 if (itm->estimate() < alreadystored->second.first) {
629 hitangleassociation.insert(std::make_pair(
hit, std::make_pair(itm->estimate(), tanangle)));
632 hitangleassociation.insert(std::make_pair(
hit, std::make_pair(itm->estimate(), tanangle)));
642 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator hitsiter;
644 for (hitsiter = hitangleassociation.begin(); hitsiter != hitangleassociation.end(); hitsiter++) {
650 size = (cluster->amplitudes()).
size();
654 float tangent = hitsiter->second.second;
658 detparmap::iterator thedet =
detmap.find(detid.
rawId());
660 if (thedet !=
detmap.end())
661 localmagdir = thedet->second->magfield;
662 float localmagfield = localmagdir.
mag();
664 if (localmagfield != 0.) {
667 float normprojection = (localmagdir * ylocal) / (localmagfield);
669 if (normprojection == 0.)
670 LogDebug(
"SiStripLAProfileBooker::analyze") <<
"Error: YBprojection = 0";
673 float signprojcorrection = 1 / normprojection;
674 tangent *= signprojcorrection;
680 histomap::iterator thehisto =
histos.find(detid.
rawId());
682 if (thehisto ==
histos.end())
684 <<
"Error: the profile associated to" << detid.
rawId() <<
"does not exist! ";
686 thehisto->second->Fill(tangent,
size);
690 unsigned int layerid;
692 histomap::iterator thesummaryhisto =
summaryhisto.find(layerid);
695 <<
"Error: the profile associated to subdet " <<
name <<
"does not exist! ";
697 thesummaryhisto->second->Fill(tangent,
size);
706 unsigned int& layerid) {
708 std::stringstream layernum;
711 name +=
"TIB_Layer_";
721 name +=
"TOB_Layer_";
731 name += layernum.str();