22 dataLabel_(iConfig.getUntrackedParameter<std::
string>(
"dataLabel",
"")),
24 fp_(iConfig.getUntrackedParameter<edm::
FileInPath>(
"file",edm::
FileInPath(
"CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
25 Cluster_src_(iConfig.getParameter<edm::InputTag>(
"Cluster_src" )),
26 Track_src_(iConfig.getUntrackedParameter<edm::InputTag>(
"Track_src" )),
27 tracksCollection_in_EventTree(iConfig.getUntrackedParameter<bool>(
"RemoveTrackClusters",
false)),
48 if (AlgoName==
"SiStripHotStripAlgorithmFromClusterOccupancy"){
50 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::getNewObject] call to SiStripHotStripAlgorithmFromClusterOccupancy"<<std::endl;
60 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::getNewObject] copy SiStripObject in SiStripBadStrip"<<std::endl;
66 for(;rIter!=rIterEnd;++rIter){
67 SiStripBadStrip::Range range(qobj->getDataVectorBegin()+rIter->ibegin,qobj->getDataVectorBegin()+rIter->iend);
68 if ( ! obj->
put(rIter->detid,range) )
69 edm::LogError(
"SiStripQualityHotStripIdentifier")<<
"[SiStripQualityHotStripIdentifier::getNewObject] detid already exists"<<std::endl;
71 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::getNewObject] " << ss.str() << std::endl;
74 edm::LogError(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::getNewObject] call for a unknow HotStrip identification algoritm"<<std::endl;
76 std::vector<uint32_t>
a;
78 if ( ! obj->
put(0xFFFFFFFF,range) )
79 edm::LogError(
"SiStripQualityHotStripIdentifier")<<
"[SiStripQualityHotStripIdentifier::getNewObject] detid already exists"<<std::endl;
109 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::resetHistos] " << std::endl;
112 for (;it!=iEnd;++it){
118 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::bookHistos] " << std::endl;
120 std::map<uint32_t, SiStripDetInfoFileReader::DetInfo >::const_iterator it =
reader->
getAllData().begin();
121 std::map<uint32_t, SiStripDetInfoFileReader::DetInfo >::const_iterator iEnd =
reader->
getAllData().end();
122 for(; it!=iEnd; ++it){
123 sprintf(hname,
"h_%d",it->first);
126 ClusterPositionHistoMap[it->first]=boost::shared_ptr<TH1F>(
new TH1F(hname,hname,it->second.nApvs*128,-0.5,it->second.nApvs*128-0.5));
129 edm::LogError(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::bookHistos] DetId " << it->first <<
" already found in map. Ignoring new data"<<std::endl;
137 ref->second->Fill(value);
139 edm::LogError(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::fillHisto] Histogram not found in the list for DetId " << detid <<
" Ignoring data value "<< value <<std::endl;
150 if(!trackCollection.
isValid()){
151 edm::LogError(
"SiStripQualityHotStripIdentifier")<<
" [SiStripQualityHotStripIdentifier::algoAnalyze] missing trackCollection with label " <<
Track_src_ <<std::endl;
155 std::set<const void*> vPSiStripCluster;
161 for (reco::TrackCollection::const_iterator track=tC.begin(); track!=tC.end(); track++){
162 LogTrace(
"SiStripQualityHotStripIdentifier")
163 <<
"Track number "<< i+1
164 <<
"\n\tmomentum: " << track->momentum()
165 <<
"\n\tPT: " << track->pt()
166 <<
"\n\tvertex: " << track->vertex()
167 <<
"\n\timpact parameter: " << track->d0()
168 <<
"\n\tcharge: " << track->charge()
169 <<
"\n\tnormalizedChi2: " << track->normalizedChi2()
170 <<
"\n\tFrom EXTRA : "
171 <<
"\n\t\touter PT "<< track->outerPt()<<std::endl;
178 LogTrace(
"SiStripQualityHotStripIdentifier") <<
"\t\t Invalid Hit "<<std::endl;
182 const SiStripRecHit2D* singleHit=
dynamic_cast<const SiStripRecHit2D*
>(recHit);
183 const SiStripMatchedRecHit2D* matchedHit=
dynamic_cast<const SiStripMatchedRecHit2D*
>(recHit);
184 const ProjectedSiStripRecHit2D* projectedHit=
dynamic_cast<const ProjectedSiStripRecHit2D*
>(recHit);
187 vPSiStripCluster.insert((
void *)&(matchedHit->monoCluster()));
188 vPSiStripCluster.insert((
void *)&(matchedHit->stereoCluster()));
189 }
else if(projectedHit){
190 vPSiStripCluster.insert((
void *)&*(projectedHit->originalHit().cluster()));
191 }
else if(singleHit){
192 vPSiStripCluster.insert((
void*)&*(singleHit->cluster()));
194 LogTrace(
"SiStripQualityHotStripIdentifier") <<
"NULL hit" << std::endl;
200 std::stringstream
ss;
203 for (; DSViter!=dsv_SiStripCluster->end();DSViter++){
206 for(; ClusIter!=ClusIterEnd; ++
ClusIter) {
208 if (
std::find(vPSiStripCluster.begin(),vPSiStripCluster.end(),(
void*) &*ClusIter) == vPSiStripCluster.end()){
210 ss <<
" adding cluster to histo for detid " << DSViter->id <<
" with barycenter "<< ClusIter->barycenter() << std::endl;
211 fillHisto(DSViter->id,ClusIter->barycenter());
216 LogTrace(
"SiStripQualityHotStripIdentifier") << ss.str();
void setProbabilityThreshold(long double prob)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void fillHisto(uint32_t detid, float value)
void extractBadStrips(SiStripQuality *, HistoMap &, edm::ESHandle< SiStripQuality > &)
std::vector< Track > TrackCollection
collection of Tracks
const edm::ParameterSet conf_
Registry::const_iterator RegistryIterator
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
edm::InputTag Cluster_src_
~SiStripQualityHotStripIdentifier()
SiStripQualityHotStripIdentifier(const edm::ParameterSet &)
edmNew::DetSet< SiStripCluster >::const_iterator ClusIter
const std::map< uint32_t, DetInfo > & getAllData() const
void algoBeginRun(const edm::Run &, const edm::EventSetup &)
unsigned long long m_cacheID_
SiStrip::QualityHistosMap ClusterPositionHistoMap
bool tracksCollection_in_EventTree
unsigned short MinClusterWidth_
void setMinNumEntries(unsigned short m)
edm::ESHandle< SiStripQuality > SiStripQuality_
unsigned short MaxClusterWidth_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
iterator end()
Return the off-the-end iterator.
SiStripBadStrip * getNewObject()
tuple SiStripDetInfoFileReader
T const * product() const
T const * product() const
SiStripDetInfoFileReader * reader
std::pair< ContainerIterator, ContainerIterator > Range
iterator begin()
Return an iterator to the first DetSet.
const TrackerTopology * tTopo
volatile std::atomic< bool > shutdown_flag false
std::string fullPath() const
bool put(const uint32_t &detID, const InputVector &vect)
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator
tuple size
Write out results.
void setMinNumEntriesPerStrip(unsigned short m)
void algoAnalyze(const edm::Event &, const edm::EventSetup &)