51 :
public std::binary_function< const SiStripRecHit2D*,const SiStripRecHit2D*,bool> {
56 bool operator()(
const SiStripRecHit2D*
a,
const SiStripRecHit2D*
b)
const {
57 return *(a->cluster())<*(b->cluster());
87 std::vector<uint32_t> activeDets;
92 tkmechstruct->addActiveDetectorsRawIds(activeDets);
96 TrackerGeometry::DetIdContainer::const_iterator Iditer;
98 for(Iditer=Id.begin();Iditer!=Id.end();Iditer++){
99 activeDets.push_back(Iditer->rawId());
117 Hit_Tree = hFile->mkdir(
"Hit_Tree");
121 HitsTree =
new TTree(
"HitsTree",
"HitsTree");
157 TrackTree =
new TTree(
"TrackTree",
"TrackTree");
163 EventTree =
new TTree(
"EventTree",
"EventTree");
180 for(std::vector<uint32_t>::const_iterator Id = activeDets.begin(); Id!=activeDets.end(); Id++){
184 DetId *Iditer=&Iditero;
189 module_bin = TIB_bin;
191 module_bin = TOB_bin;
200 if(stripdet==0)
continue;
222 unsigned int layerid;
224 name+=TkTag.
label().c_str();
229 summaryprofile=
dbe_->
bookProfile(name,name,SUM_bin,TIBRangeMin,TIBRangeMax,20,0,5,
"");
231 summaryprofile=
dbe_->
bookProfile(name,name,SUM_bin,TOBRangeMin,TOBRangeMax,20,0,5,
"");
236 summaryparam->
thickness = thickness*10000;
262 detparmap::iterator detpariter;
263 for( detpariter=
detmap.begin(); detpariter!=
detmap.end();++detpariter)
delete detpariter->second;
300 std::map<const SiStripRecHit2D*,std::pair<float,float>,DetIdLess> hitangleassociation;
301 std::list<SiStripRecHit2D> cache;
304 trajsize=TrajectoryCollection->size();
307 edm::LogInfo(
"SiStripLAProfileBooker::analyze") <<
" Number of trajectories in event = "<<
trajsize<<
"\n";
311 for(TrajTrackIter = TrajTrackMap->begin(); TrajTrackIter!= TrajTrackMap->end(); TrajTrackIter++){
313 if(TrajTrackIter->key->foundHits()>=5){
326 pt = TrajTrackIter->val->pt();
328 chi2norm = TrajTrackIter->val->normalizedChi2();
329 EtaTrack = TrajTrackIter->val->eta();
330 PhiTrack = TrajTrackIter->val->phi();
333 std::vector<TrajectoryMeasurement> TMeas=TrajTrackIter->key->measurements();
334 std::vector<TrajectoryMeasurement>::iterator itm;
336 for (itm=TMeas.begin();itm!=TMeas.end();itm++){
364 SiStripRecHit2D lhit;
368 const SiStripMatchedRecHit2D* matchedhit=
dynamic_cast<const SiStripMatchedRecHit2D*
>((*thit).hit());
369 const ProjectedSiStripRecHit2D* phit=
dynamic_cast<const ProjectedSiStripRecHit2D*
>((*thit).hit());
370 const SiStripRecHit2D*
hit=
dynamic_cast<const SiStripRecHit2D*
>((*thit).hit());
371 if(phit) {lhit = phit->originalHit(); hit = &lhit;}
384 cache.push_back(matchedhit->monoHit());
385 const SiStripRecHit2D * monohit = &cache.back();
386 const SiStripRecHit2D::ClusterRef & monocluster=monohit->cluster();
389 const LocalPoint monoposition = monohit->localPosition();
399 const std::vector<uint8_t> amplitudes = monocluster->amplitudes();
402 uint16_t FirstStrip = monocluster->firstStrip();
403 std::vector<uint8_t>::const_iterator idigi;
404 std::vector<uint8_t>::const_iterator
begin=amplitudes.begin();
406 for(idigi=begin; idigi!=amplitudes.end(); idigi++){
446 if(monotkdir.
z()!=0){
449 float tanangle = monotkdir.
x()/monotkdir.
z();
452 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
454 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
458 float signcorrection = (localmagdir * monoylocal)/(
MagField);
462 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(monohit);
465 if(alreadystored != hitangleassociation.end()){
466 if(itm->estimate() > alreadystored->second.first){
468 if(itm->estimate() < alreadystored->second.first){
470 hitangleassociation.insert(std::make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
474 hitangleassociation.insert(make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
481 cache.push_back(matchedhit->stereoHit());
482 const SiStripRecHit2D * stereohit = &cache.back();
483 const SiStripRecHit2D::ClusterRef & stereocluster=stereohit->cluster();
486 const LocalPoint stereoposition = stereohit->localPosition();
494 ClSize = (stereocluster->amplitudes()).
size();
496 const std::vector<uint8_t> amplitudes = stereocluster->amplitudes();
498 barycenter = stereocluster->barycenter()- 0.5;
499 uint16_t FirstStrip = stereocluster->firstStrip();
500 std::vector<uint8_t>::const_iterator idigi;
501 std::vector<uint8_t>::const_iterator begin=amplitudes.begin();
503 for(idigi=begin; idigi!=amplitudes.end(); idigi++){
542 if(stereotkdir.
z()!=0){
545 float tanangle = stereotkdir.
x()/stereotkdir.
z();
548 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
550 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
554 float signcorrection = (localmagdir * stereoylocal)/(
MagField);
557 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(stereohit);
559 if(alreadystored != hitangleassociation.end()){
560 if(itm->estimate() > alreadystored->second.first){
562 if(itm->estimate() < alreadystored->second.first){
564 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
568 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
580 const SiStripRecHit2D::ClusterRef & cluster=hit->cluster();
593 const std::vector<uint8_t> amplitudes = cluster->amplitudes();
596 uint16_t FirstStrip = cluster->firstStrip();
597 std::vector<uint8_t>::const_iterator idigi;
598 std::vector<uint8_t>::const_iterator
begin=amplitudes.begin();
600 for(idigi=begin; idigi!=amplitudes.end(); idigi++){
636 if(trackdirection.
z()!=0){
639 float tanangle = trackdirection.
x()/trackdirection.
z();
642 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
644 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
648 float signcorrection = (localmagdir * ylocal)/(
MagField);
651 std::map<const SiStripRecHit2D *,std::pair<float,float>, DetIdLess>::iterator alreadystored=hitangleassociation.find(hit);
653 if(alreadystored != hitangleassociation.end()){
654 if(itm->estimate() > alreadystored->second.first){
656 if(itm->estimate() < alreadystored->second.first){
658 hitangleassociation.insert(std::make_pair(hit, std::make_pair(itm->estimate(),tanangle)));
662 hitangleassociation.insert(std::make_pair(hit,std::make_pair(itm->estimate(), tanangle) ) );
673 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator hitsiter;
676 for(hitsiter=hitangleassociation.begin();hitsiter!=hitangleassociation.end();hitsiter++){
680 const SiStripRecHit2D*
hit=hitsiter->first;
681 const SiStripRecHit2D::ClusterRef & cluster=hit->cluster();
683 size=(cluster->amplitudes()).
size();
687 float tangent = hitsiter->second.second;
691 detparmap::iterator thedet=
detmap.find(detid.
rawId());
693 if(thedet!=
detmap.end())localmagdir=thedet->second->magfield;
694 float localmagfield = localmagdir.
mag();
696 if(localmagfield != 0.){
700 float normprojection = (localmagdir * ylocal)/(localmagfield);
702 if(normprojection == 0.)
LogDebug(
"SiStripLAProfileBooker::analyze")<<
"Error: YBprojection = 0";
705 float signprojcorrection = 1/normprojection;
706 tangent*=signprojcorrection;
712 histomap::iterator thehisto=
histos.find(detid.
rawId());
714 if(thehisto==
histos.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to"<<detid.
rawId()<<
"does not exist! ";
715 else thehisto->second->Fill(tangent,
size);
719 unsigned int layerid;
721 histomap::iterator thesummaryhisto=
summaryhisto.find(layerid);
722 if(thesummaryhisto==
summaryhisto.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to subdet "<<name<<
"does not exist! ";
723 else thesummaryhisto->second->Fill(tangent,
size);
735 std::stringstream layernum;
762 name+=layernum.str();
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
unsigned int tibLayer(const DetId &id) const
unsigned int tidRing(const DetId &id) const
const GeomDetUnit * monoDet() const
friend struct const_iterator
std::vector< unsigned int > tidModuleInfo(const DetId &id) const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
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
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)
~SiStripLAProfileBooker()
std::vector< unsigned int > tibStringInfo(const DetId &id) const
const Plane & surface() const
The nominal surface of the GeomDet.
static int position[TOTALCHAMBERS][3]
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
uint32_t rawId() const
get the raw id
virtual float thickness() const =0
virtual const Topology & topology() const =0
virtual float localPitch(const LocalPoint &) const =0
std::vector< unsigned int > tecPetalInfo(const DetId &id) const
void beginRun(const edm::EventSetup &c)
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)
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
virtual const GeomDet * idToDet(DetId) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void analyze(const edm::Event &e, const edm::EventSetup &c)
unsigned int stereo() const
stereo
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
bool operator()(const SiStripRecHit2D *a, const SiStripRecHit2D *b) const
T const * product() const
std::vector< Trajectory > TrajectoryCollection
float TanTrackAngleParallel
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
SiStripLAProfileBooker(const edm::ParameterSet &conf)
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)
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
std::vector< DetId > DetIdContainer
const TrackerGeometry * tracker