55 return *(
a->cluster()) < *(
b->cluster());
80 std::vector<uint32_t> activeDets;
88 TrackerGeometry::DetIdContainer::const_iterator Iditer;
90 for (Iditer = Id.begin(); Iditer != Id.end(); Iditer++) {
91 activeDets.push_back(Iditer->rawId());
113 HitsTree =
new TTree(
"HitsTree",
"HitsTree");
149 TrackTree =
new TTree(
"TrackTree",
"TrackTree");
155 EventTree =
new TTree(
"EventTree",
"EventTree");
171 for (std::vector<uint32_t>::const_iterator Id = activeDets.begin(); Id != activeDets.end(); Id++) {
174 DetId* Iditer = &Iditero;
180 module_bin = TIB_bin;
182 module_bin = TOB_bin;
191 if (!stripdet->isLeaf())
194 float thickness = stripdet->specificSurface().bounds().thickness();
205 const GlobalPoint globalp = (stripdet->surface()).toGlobal(
p);
209 profile->setAxisTitle(
"tan(#theta_{t})", 1);
210 profile->setAxisTitle(
"Cluster size", 2);
214 unsigned int layerid;
224 if (summaryprofile) {
252 detparmap::iterator detpariter;
253 for (detpariter =
detmap.begin(); detpariter !=
detmap.end(); ++detpariter)
254 delete detpariter->second;
256 delete detpariter->second;
286 e.getByLabel(TkTag, TrajTrackMap);
291 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess> hitangleassociation;
292 std::list<SiStripRecHit2D>
cache;
298 edm::LogInfo(
"SiStripLAProfileBooker::analyze") <<
" Number of trajectories in event = " <<
trajsize <<
"\n";
302 for (TrajTrackIter = TrajTrackMap->
begin(); TrajTrackIter != TrajTrackMap->
end();
305 if (TrajTrackIter->key->foundHits() >= 5) {
317 pt = TrajTrackIter->val->pt();
319 chi2norm = TrajTrackIter->val->normalizedChi2();
320 EtaTrack = TrajTrackIter->val->eta();
321 PhiTrack = TrajTrackIter->val->phi();
324 std::vector<TrajectoryMeasurement> TMeas = TrajTrackIter->key->measurements();
325 std::vector<TrajectoryMeasurement>::iterator itm;
327 for (itm = TMeas.begin(); itm != TMeas.end(); itm++) {
330 for (
i = 0;
i < 100;
i++) {
366 lhit = phit->originalHit();
396 const auto& amplitudes = monocluster->amplitudes();
399 uint16_t FirstStrip = monocluster->firstStrip();
400 auto begin = amplitudes.begin();
402 for (
auto idigi =
begin; idigi != amplitudes.end(); idigi++) {
436 if (monotkdir.
z() != 0) {
438 float tanangle = monotkdir.
x() / monotkdir.
z();
441 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
443 if (TheDet !=
detmap.end())
444 localmagdir = TheDet->second->magfield;
448 float signcorrection = (localmagdir * monoylocal) / (
MagField);
449 if (signcorrection != 0)
453 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
454 hitangleassociation.find(monohit);
456 if (alreadystored != hitangleassociation.end()) {
457 if (itm->estimate() > alreadystored->second.first) {
460 if (itm->estimate() < alreadystored->second.first) {
462 hitangleassociation.insert(std::make_pair(monohit, std::make_pair(itm->estimate(), tanangle)));
465 hitangleassociation.insert(make_pair(monohit, std::make_pair(itm->estimate(), tanangle)));
486 ClSize = (stereocluster->amplitudes()).
size();
488 const auto& amplitudes = stereocluster->amplitudes();
490 barycenter = stereocluster->barycenter() - 0.5;
491 uint16_t FirstStrip = stereocluster->firstStrip();
492 auto begin = amplitudes.begin();
494 for (
auto idigi =
begin; idigi != amplitudes.end(); idigi++) {
528 if (stereotkdir.
z() != 0) {
530 float tanangle = stereotkdir.
x() / stereotkdir.
z();
533 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
535 if (TheDet !=
detmap.end())
536 localmagdir = TheDet->second->magfield;
540 float signcorrection = (localmagdir * stereoylocal) / (
MagField);
541 if (signcorrection != 0)
545 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
546 hitangleassociation.find(stereohit);
548 if (alreadystored != hitangleassociation.end()) {
549 if (itm->estimate() > alreadystored->second.first) {
552 if (itm->estimate() < alreadystored->second.first) {
554 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(), tanangle)));
557 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(), tanangle)));
579 const auto& amplitudes = cluster->amplitudes();
582 uint16_t FirstStrip = cluster->firstStrip();
584 auto begin = amplitudes.begin();
585 for (
auto idigi = amplitudes.begin(); idigi != amplitudes.end(); idigi++) {
617 if (trackdirection.
z() != 0) {
619 float tanangle = trackdirection.
x() / trackdirection.
z();
622 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
624 if (TheDet !=
detmap.end())
625 localmagdir = TheDet->second->magfield;
629 float signcorrection = (localmagdir * ylocal) / (
MagField);
630 if (signcorrection != 0)
634 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
635 hitangleassociation.find(
hit);
637 if (alreadystored != hitangleassociation.end()) {
638 if (itm->estimate() > alreadystored->second.first) {
641 if (itm->estimate() < alreadystored->second.first) {
643 hitangleassociation.insert(std::make_pair(
hit, std::make_pair(itm->estimate(), tanangle)));
646 hitangleassociation.insert(std::make_pair(
hit, std::make_pair(itm->estimate(), tanangle)));
656 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator hitsiter;
658 for (hitsiter = hitangleassociation.begin(); hitsiter != hitangleassociation.end(); hitsiter++) {
664 size = (cluster->amplitudes()).
size();
668 float tangent = hitsiter->second.second;
672 detparmap::iterator thedet =
detmap.find(detid.
rawId());
674 if (thedet !=
detmap.end())
675 localmagdir = thedet->second->magfield;
676 float localmagfield = localmagdir.
mag();
678 if (localmagfield != 0.) {
681 float normprojection = (localmagdir * ylocal) / (localmagfield);
683 if (normprojection == 0.)
684 LogDebug(
"SiStripLAProfileBooker::analyze") <<
"Error: YBprojection = 0";
687 float signprojcorrection = 1 / normprojection;
688 tangent *= signprojcorrection;
694 histomap::iterator thehisto =
histos.find(detid.
rawId());
696 if (thehisto ==
histos.end())
698 <<
"Error: the profile associated to" << detid.
rawId() <<
"does not exist! ";
700 thehisto->second->Fill(tangent,
size);
704 unsigned int layerid;
706 histomap::iterator thesummaryhisto =
summaryhisto.find(layerid);
709 <<
"Error: the profile associated to subdet " <<
name <<
"does not exist! ";
711 thesummaryhisto->second->Fill(tangent,
size);
720 unsigned int& layerid) {
722 std::stringstream layernum;
725 name +=
"TIB_Layer_";
735 name +=
"TOB_Layer_";
745 name += layernum.str();
746 layerid = detid.
subdetId() * 10 + layer;