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();
333 std::vector<TrajectoryMeasurement> TMeas=TrajTrackIter->
key->measurements();
334 std::vector<TrajectoryMeasurement>::iterator itm;
336 for (itm=TMeas.begin();itm!=TMeas.end();itm++){
367 const SiStripMatchedRecHit2D* matchedhit=
dynamic_cast<const SiStripMatchedRecHit2D*
>((*thit).hit());
369 const SiStripRecHit2D*
hit=
dynamic_cast<const SiStripRecHit2D*
>((*thit).hit());
383 cache.push_back(matchedhit->monoHit());
384 const SiStripRecHit2D * monohit = &cache.back();
385 const SiStripRecHit2D::ClusterRef & monocluster=monohit->cluster();
388 const LocalPoint monoposition = monohit->localPosition();
398 const std::vector<uint8_t> amplitudes = monocluster->amplitudes();
401 uint16_t FirstStrip = monocluster->firstStrip();
402 std::vector<uint8_t>::const_iterator idigi;
403 std::vector<uint8_t>::const_iterator
begin=amplitudes.begin();
405 for(idigi=begin; idigi!=amplitudes.end(); idigi++){
445 if(monotkdir.
z()!=0){
448 float tanangle = monotkdir.
x()/monotkdir.
z();
451 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
453 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
457 float signcorrection = (localmagdir * monoylocal)/(
MagField);
461 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(monohit);
464 if(alreadystored != hitangleassociation.end()){
465 if(itm->estimate() > alreadystored->second.first){
467 if(itm->estimate() < alreadystored->second.first){
469 hitangleassociation.insert(std::make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
473 hitangleassociation.insert(make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
480 cache.push_back(matchedhit->stereoHit());
481 const SiStripRecHit2D * stereohit = &cache.back();
482 const SiStripRecHit2D::ClusterRef & stereocluster=stereohit->cluster();
485 const LocalPoint stereoposition = stereohit->localPosition();
493 ClSize = (stereocluster->amplitudes()).
size();
495 const std::vector<uint8_t> amplitudes = stereocluster->amplitudes();
497 barycenter = stereocluster->barycenter()- 0.5;
498 uint16_t FirstStrip = stereocluster->firstStrip();
499 std::vector<uint8_t>::const_iterator idigi;
500 std::vector<uint8_t>::const_iterator begin=amplitudes.begin();
502 for(idigi=begin; idigi!=amplitudes.end(); idigi++){
541 if(stereotkdir.
z()!=0){
544 float tanangle = stereotkdir.
x()/stereotkdir.
z();
547 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
549 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
553 float signcorrection = (localmagdir * stereoylocal)/(
MagField);
556 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(stereohit);
558 if(alreadystored != hitangleassociation.end()){
559 if(itm->estimate() > alreadystored->second.first){
561 if(itm->estimate() < alreadystored->second.first){
563 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
567 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
579 const SiStripRecHit2D::ClusterRef & cluster=hit->cluster();
592 const std::vector<uint8_t> amplitudes = cluster->amplitudes();
595 uint16_t FirstStrip = cluster->firstStrip();
596 std::vector<uint8_t>::const_iterator idigi;
597 std::vector<uint8_t>::const_iterator
begin=amplitudes.begin();
599 for(idigi=begin; idigi!=amplitudes.end(); idigi++){
635 if(trackdirection.
z()!=0){
638 float tanangle = trackdirection.
x()/trackdirection.
z();
641 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
643 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
647 float signcorrection = (localmagdir * ylocal)/(
MagField);
650 std::map<const SiStripRecHit2D *,std::pair<float,float>, DetIdLess>::iterator alreadystored=hitangleassociation.find(hit);
652 if(alreadystored != hitangleassociation.end()){
653 if(itm->estimate() > alreadystored->second.first){
655 if(itm->estimate() < alreadystored->second.first){
657 hitangleassociation.insert(std::make_pair(hit, std::make_pair(itm->estimate(),tanangle)));
661 hitangleassociation.insert(std::make_pair(hit,std::make_pair(itm->estimate(), tanangle) ) );
672 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator hitsiter;
675 for(hitsiter=hitangleassociation.begin();hitsiter!=hitangleassociation.end();hitsiter++){
679 const SiStripRecHit2D*
hit=hitsiter->first;
680 const SiStripRecHit2D::ClusterRef & cluster=hit->cluster();
682 size=(cluster->amplitudes()).
size();
686 float tangent = hitsiter->second.second;
690 detparmap::iterator thedet=
detmap.find(detid.
rawId());
692 if(thedet!=
detmap.end())localmagdir=thedet->second->magfield;
693 float localmagfield = localmagdir.
mag();
695 if(localmagfield != 0.){
699 float normprojection = (localmagdir * ylocal)/(localmagfield);
701 if(normprojection == 0.)
LogDebug(
"SiStripLAProfileBooker::analyze")<<
"Error: YBprojection = 0";
704 float signprojcorrection = 1/normprojection;
705 tangent*=signprojcorrection;
711 histomap::iterator thehisto=
histos.find(detid.
rawId());
713 if(thehisto==
histos.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to"<<detid.
rawId()<<
"does not exist! ";
714 else thehisto->second->Fill(tangent,
size);
718 unsigned int layerid;
720 histomap::iterator thesummaryhisto=
summaryhisto.find(layerid);
721 if(thesummaryhisto==
summaryhisto.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to subdet "<<name<<
"does not exist! ";
722 else thesummaryhisto->second->Fill(tangent,
size);
734 std::stringstream layernum;
761 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
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
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
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
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
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)
const SiStripRecHit2D & originalHit() 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
std::vector< DetId > DetIdContainer
const TrackerGeometry * tracker