86 std::vector<uint32_t> activeDets;
95 TrackerGeometry::DetIdContainer::const_iterator Iditer;
97 for(Iditer=Id.begin();Iditer!=Id.end();Iditer++){
98 activeDets.push_back(Iditer->rawId());
116 Hit_Tree = hFile->mkdir(
"Hit_Tree");
120 HitsTree =
new TTree(
"HitsTree",
"HitsTree");
156 TrackTree =
new TTree(
"TrackTree",
"TrackTree");
162 EventTree =
new TTree(
"EventTree",
"EventTree");
179 for(std::vector<uint32_t>::const_iterator Id = activeDets.begin(); Id!=activeDets.end(); Id++){
183 DetId *Iditer=&Iditero;
188 module_bin = TIB_bin;
190 module_bin = TOB_bin;
199 if(!stripdet->isLeaf())
continue;
201 float thickness=stripdet->specificSurface().bounds().thickness();
212 const GlobalPoint globalp = (stripdet->surface()).toGlobal(p);
221 unsigned int layerid;
228 summaryprofile=
dbe_->
bookProfile(name,name,SUM_bin,TIBRangeMin,TIBRangeMax,20,0,5,
"");
230 summaryprofile=
dbe_->
bookProfile(name,name,SUM_bin,TOBRangeMin,TOBRangeMax,20,0,5,
"");
235 summaryparam->
thickness = thickness*10000;
261 detparmap::iterator detpariter;
262 for( detpariter=
detmap.begin(); detpariter!=
detmap.end();++detpariter)
delete detpariter->second;
299 std::map<const SiStripRecHit2D*,std::pair<float,float>,DetIdLess> hitangleassociation;
300 std::list<SiStripRecHit2D>
cache;
303 trajsize=TrajectoryCollection->size();
306 edm::LogInfo(
"SiStripLAProfileBooker::analyze") <<
" Number of trajectories in event = "<<
trajsize<<
"\n";
310 for(TrajTrackIter = TrajTrackMap->
begin(); TrajTrackIter!= TrajTrackMap->
end(); TrajTrackIter++){
312 if(TrajTrackIter->key->foundHits()>=5){
325 pt = TrajTrackIter->val->pt();
327 chi2norm = TrajTrackIter->val->normalizedChi2();
328 EtaTrack = TrajTrackIter->val->eta();
329 PhiTrack = TrajTrackIter->val->phi();
332 std::vector<TrajectoryMeasurement> TMeas=TrajTrackIter->key->measurements();
333 std::vector<TrajectoryMeasurement>::iterator itm;
335 for (itm=TMeas.begin();itm!=TMeas.end();itm++){
370 if(phit) {lhit = phit->
originalHit(); hit = &lhit;}
383 cache.push_back(matchedhit->
monoHit());
398 const auto & amplitudes = monocluster->amplitudes();
401 uint16_t FirstStrip = monocluster->firstStrip();
402 auto begin=amplitudes.begin();
404 for(
auto idigi=
begin; idigi!=amplitudes.end(); idigi++){
444 if(monotkdir.
z()!=0){
447 float tanangle = monotkdir.
x()/monotkdir.
z();
450 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
452 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
456 float signcorrection = (localmagdir * monoylocal)/(
MagField);
460 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(monohit);
463 if(alreadystored != hitangleassociation.end()){
464 if(itm->estimate() > alreadystored->second.first){
466 if(itm->estimate() < alreadystored->second.first){
468 hitangleassociation.insert(std::make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
472 hitangleassociation.insert(make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
479 cache.push_back(matchedhit->
stereoHit());
492 ClSize = (stereocluster->amplitudes()).
size();
494 const auto & amplitudes = stereocluster->amplitudes();
496 barycenter = stereocluster->barycenter()- 0.5;
497 uint16_t FirstStrip = stereocluster->firstStrip();
498 auto begin=amplitudes.begin();
500 for(
auto idigi=
begin; idigi!=amplitudes.end(); idigi++){
539 if(stereotkdir.
z()!=0){
542 float tanangle = stereotkdir.
x()/stereotkdir.
z();
545 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
547 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
551 float signcorrection = (localmagdir * stereoylocal)/(
MagField);
554 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(stereohit);
556 if(alreadystored != hitangleassociation.end()){
557 if(itm->estimate() > alreadystored->second.first){
559 if(itm->estimate() < alreadystored->second.first){
561 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
565 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
590 const auto & amplitudes = cluster->amplitudes();
593 uint16_t FirstStrip = cluster->firstStrip();
595 auto begin =amplitudes.begin();
596 for(
auto idigi=amplitudes.begin(); idigi!=amplitudes.end(); idigi++){
632 if(trackdirection.
z()!=0){
635 float tanangle = trackdirection.
x()/trackdirection.
z();
638 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
640 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
644 float signcorrection = (localmagdir * ylocal)/(
MagField);
647 std::map<const SiStripRecHit2D *,std::pair<float,float>, DetIdLess>::iterator alreadystored=hitangleassociation.find(hit);
649 if(alreadystored != hitangleassociation.end()){
650 if(itm->estimate() > alreadystored->second.first){
652 if(itm->estimate() < alreadystored->second.first){
654 hitangleassociation.insert(std::make_pair(hit, std::make_pair(itm->estimate(),tanangle)));
658 hitangleassociation.insert(std::make_pair(hit,std::make_pair(itm->estimate(), tanangle) ) );
669 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator hitsiter;
672 for(hitsiter=hitangleassociation.begin();hitsiter!=hitangleassociation.end();hitsiter++){
679 size=(cluster->amplitudes()).
size();
683 float tangent = hitsiter->second.second;
687 detparmap::iterator thedet=
detmap.find(detid.
rawId());
689 if(thedet!=
detmap.end())localmagdir=thedet->second->magfield;
690 float localmagfield = localmagdir.
mag();
692 if(localmagfield != 0.){
696 float normprojection = (localmagdir * ylocal)/(localmagfield);
698 if(normprojection == 0.)
LogDebug(
"SiStripLAProfileBooker::analyze")<<
"Error: YBprojection = 0";
701 float signprojcorrection = 1/normprojection;
702 tangent*=signprojcorrection;
708 histomap::iterator thehisto=
histos.find(detid.
rawId());
710 if(thehisto==
histos.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to"<<detid.
rawId()<<
"does not exist! ";
711 else thehisto->second->Fill(tangent,
size);
715 unsigned int layerid;
717 histomap::iterator thesummaryhisto=
summaryhisto.find(layerid);
718 if(thesummaryhisto==
summaryhisto.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to subdet "<<name<<
"does not exist! ";
719 else thesummaryhisto->second->Fill(tangent,
size);
731 std::stringstream layernum;
758 name+=layernum.str();
T getParameter(std::string const &) const
EventNumber_t event() const
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.
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
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
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")
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
std::vector< DetId > DetIdContainer
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")
virtual float localPitch(const LocalPoint &) const =0
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
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
T const * product() const
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.
unsigned int tobLayer(const DetId &id) const
const TrackerGeometry * tracker