48 :
public std::binary_function< const SiStripRecHit2D*,const SiStripRecHit2D*,bool> {
80 std::vector<uint32_t> activeDets;
85 tkmechstruct->addActiveDetectorsRawIds(activeDets);
89 TrackerGeometry::DetIdContainer::const_iterator Iditer;
91 for(Iditer=Id.begin();Iditer!=Id.end();Iditer++){
92 activeDets.push_back(Iditer->rawId());
110 Hit_Tree = hFile->mkdir(
"Hit_Tree");
114 HitsTree =
new TTree(
"HitsTree",
"HitsTree");
150 TrackTree =
new TTree(
"TrackTree",
"TrackTree");
156 EventTree =
new TTree(
"EventTree",
"EventTree");
173 for(std::vector<uint32_t>::const_iterator Id = activeDets.begin(); Id!=activeDets.end(); Id++){
177 DetId *Iditer=&Iditero;
182 module_bin = TIB_bin;
184 module_bin = TOB_bin;
193 if(stripdet==0)
continue;
215 unsigned int layerid;
217 name+=TkTag.
label().c_str();
222 summaryprofile=
dbe_->
bookProfile(name,name,SUM_bin,TIBRangeMin,TIBRangeMax,20,0,5,
"");
224 summaryprofile=
dbe_->
bookProfile(name,name,SUM_bin,TOBRangeMin,TOBRangeMax,20,0,5,
"");
229 summaryparam->
thickness = thickness*10000;
255 detparmap::iterator detpariter;
256 for( detpariter=
detmap.begin(); detpariter!=
detmap.end();++detpariter)
delete detpariter->second;
288 std::map<const SiStripRecHit2D*,std::pair<float,float>,DetIdLess> hitangleassociation;
291 trajsize=TrajectoryCollection->size();
294 edm::LogInfo(
"SiStripLAProfileBooker::analyze") <<
" Number of trajectories in event = "<<
trajsize<<
"\n";
298 for(TrajTrackIter = TrajTrackMap->begin(); TrajTrackIter!= TrajTrackMap->end(); TrajTrackIter++){
300 if(TrajTrackIter->
key->foundHits()>=5){
313 pt = TrajTrackIter->
val->pt();
320 std::vector<TrajectoryMeasurement> TMeas=TrajTrackIter->
key->measurements();
321 std::vector<TrajectoryMeasurement>::iterator itm;
323 for (itm=TMeas.begin();itm!=TMeas.end();itm++){
382 const std::vector<uint8_t> amplitudes = monocluster->amplitudes();
385 uint16_t FirstStrip = monocluster->firstStrip();
386 std::vector<uint8_t>::const_iterator idigi;
387 std::vector<uint8_t>::const_iterator
begin=amplitudes.begin();
389 for(idigi=begin; idigi!=amplitudes.end(); idigi++){
429 if(monotkdir.
z()!=0){
432 float tanangle = monotkdir.
x()/monotkdir.
z();
435 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
437 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
441 float signcorrection = (localmagdir * monoylocal)/(
MagField);
444 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(monohit);
447 if(alreadystored != hitangleassociation.end()){
448 if(itm->estimate() > alreadystored->second.first){
450 if(itm->estimate() < alreadystored->second.first){
452 hitangleassociation.insert(std::make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
456 hitangleassociation.insert(make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
473 ClSize = (stereocluster->amplitudes()).
size();
475 const std::vector<uint8_t> amplitudes = stereocluster->amplitudes();
477 barycenter = stereocluster->barycenter()- 0.5;
478 uint16_t FirstStrip = stereocluster->firstStrip();
479 std::vector<uint8_t>::const_iterator idigi;
480 std::vector<uint8_t>::const_iterator begin=amplitudes.begin();
482 for(idigi=begin; idigi!=amplitudes.end(); idigi++){
521 if(stereotkdir.
z()!=0){
524 float tanangle = stereotkdir.
x()/stereotkdir.
z();
527 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
529 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
533 float signcorrection = (localmagdir * stereoylocal)/(
MagField);
536 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(stereohit);
538 if(alreadystored != hitangleassociation.end()){
539 if(itm->estimate() > alreadystored->second.first){
541 if(itm->estimate() < alreadystored->second.first){
543 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
547 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
572 const std::vector<uint8_t> amplitudes = cluster->amplitudes();
575 uint16_t FirstStrip = cluster->firstStrip();
576 std::vector<uint8_t>::const_iterator idigi;
577 std::vector<uint8_t>::const_iterator
begin=amplitudes.begin();
579 for(idigi=begin; idigi!=amplitudes.end(); idigi++){
615 if(trackdirection.
z()!=0){
618 float tanangle = trackdirection.
x()/trackdirection.
z();
621 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
623 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
627 float signcorrection = (localmagdir * ylocal)/(
MagField);
630 std::map<const SiStripRecHit2D *,std::pair<float,float>, DetIdLess>::iterator alreadystored=hitangleassociation.find(hit);
632 if(alreadystored != hitangleassociation.end()){
633 if(itm->estimate() > alreadystored->second.first){
635 if(itm->estimate() < alreadystored->second.first){
637 hitangleassociation.insert(std::make_pair(hit, std::make_pair(itm->estimate(),tanangle)));
641 hitangleassociation.insert(std::make_pair(hit,std::make_pair(itm->estimate(), tanangle) ) );
652 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator hitsiter;
655 for(hitsiter=hitangleassociation.begin();hitsiter!=hitangleassociation.end();hitsiter++){
662 size=(cluster->amplitudes()).
size();
670 float tangent = hitsiter->second.second;
674 detparmap::iterator thedet=
detmap.find(detid.
rawId());
676 if(thedet!=
detmap.end())localmagdir=thedet->second->magfield;
677 float localmagfield = localmagdir.
mag();
679 if(localmagfield != 0.){
683 float normprojection = (localmagdir * ylocal)/(localmagfield);
685 if(normprojection == 0.)
LogDebug(
"SiStripLAProfileBooker::analyze")<<
"Error: YBprojection = 0";
688 float signprojcorrection = 1/normprojection;
689 tangent*=signprojcorrection;
695 histomap::iterator thehisto=
histos.find(detid.
rawId());
697 if(thehisto==
histos.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to"<<detid.
rawId()<<
"does not exist! ";
698 else thehisto->second->Fill(tangent,
size);
702 unsigned int layerid;
704 histomap::iterator thesummaryhisto=
summaryhisto.find(layerid);
705 if(thesummaryhisto==
summaryhisto.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to subdet "<<name<<
"does not exist! ";
706 else thesummaryhisto->second->Fill(tangent,
size);
718 std::stringstream layernum;
723 layer = TIBid.
layer();
729 layer = TIDid.
ring();
735 layer = TOBid.
layer();
742 layer = TECid.
ring();
745 name+=layernum.str();
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
unsigned int layer() const
layer id
const GeomDetUnit * monoDet() const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
const SiStripRecHit2D * stereoHit() const
LocalVector localDirection() const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
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.
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
~SiStripLAProfileBooker()
std::vector< unsigned int > string() const
string id
static int position[TOTALCHAMBERS][3]
virtual LocalPoint localPosition() const
std::vector< unsigned int > rod() const
rod id
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 > petal() const
petal id
virtual const BoundPlane & specificSurface() const
Same as surface(), kept for backward compatibility.
void beginRun(const edm::EventSetup &c)
unsigned int ring() const
ring id
std::vector< unsigned int > module() const
det id
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
void setDetectorFolder(uint32_t rawdetid=0)
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
const Bounds & bounds() const
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
bool operator()(const SiStripRecHit2D *a, const SiStripRecHit2D *b) const
ClusterRef const & cluster() const
unsigned int wheel() const
wheel id
unsigned int layer() const
layer id
std::vector< Trajectory > TrajectoryCollection
float TanTrackAngleParallel
unsigned int ring() const
ring id
DetId geographicalId() const
SiStripLAProfileBooker(const edm::ParameterSet &conf)
const SiStripRecHit2D * monoHit() 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
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Power< A, B >::type pow(const A &a, const B &b)
const GeomDetUnit * stereoDet() const
unsigned int wheel() const
wheel id
std::vector< DetId > DetIdContainer
const TrackerGeometry * tracker
void getlayer(const DetId &detid, std::string &name, unsigned int &layerid)