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))
46 std::string AlgoName = parameters.
getParameter<std::string>(
"AlgoName");
47 if (AlgoName==
"SiStripHotStripAlgorithmFromClusterOccupancy"){
49 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::getNewObject] call to SiStripHotStripAlgorithmFromClusterOccupancy"<<std::endl;
59 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::getNewObject] copy SiStripObject in SiStripBadStrip"<<std::endl;
65 for(;rIter!=rIterEnd;++rIter){
67 if ( ! obj->
put(rIter->detid,range) )
68 edm::LogError(
"SiStripQualityHotStripIdentifier")<<
"[SiStripQualityHotStripIdentifier::getNewObject] detid already exists"<<std::endl;
70 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::getNewObject] " << ss.str() << std::endl;
73 edm::LogError(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::getNewObject] call for a unknow HotStrip identification algoritm"<<std::endl;
75 std::vector<uint32_t>
a;
77 if ( ! obj->
put(0xFFFFFFFF,range) )
78 edm::LogError(
"SiStripQualityHotStripIdentifier")<<
"[SiStripQualityHotStripIdentifier::getNewObject] detid already exists"<<std::endl;
103 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::resetHistos] " << std::endl;
106 for (;it!=iEnd;++it){
112 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::bookHistos] " << std::endl;
114 std::map<uint32_t, SiStripDetInfoFileReader::DetInfo >::const_iterator it =
reader->
getAllData().begin();
115 std::map<uint32_t, SiStripDetInfoFileReader::DetInfo >::const_iterator iEnd =
reader->
getAllData().end();
116 for(; it!=iEnd; ++it){
117 sprintf(hname,
"h_%d",it->first);
120 ClusterPositionHistoMap[it->first]=boost::shared_ptr<TH1F>(
new TH1F(hname,hname,it->second.nApvs*128,-0.5,it->second.nApvs*128-0.5));
123 edm::LogError(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::bookHistos] DetId " << it->first <<
" already found in map. Ignoring new data"<<std::endl;
131 ref->second->Fill(value);
133 edm::LogError(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::fillHisto] Histogram not found in the list for DetId " << detid <<
" Ignoring data value "<< value <<std::endl;
144 if(!trackCollection.
isValid()){
145 edm::LogError(
"SiStripQualityHotStripIdentifier")<<
" [SiStripQualityHotStripIdentifier::algoAnalyze] missing trackCollection with label " <<
Track_src_ <<std::endl;
149 std::set<const void*> vPSiStripCluster;
155 for (reco::TrackCollection::const_iterator track=tC.begin(); track!=tC.end(); track++){
156 LogTrace(
"SiStripQualityHotStripIdentifier")
157 <<
"Track number "<< i+1
158 <<
"\n\tmomentum: " << track->momentum()
159 <<
"\n\tPT: " << track->pt()
160 <<
"\n\tvertex: " << track->vertex()
161 <<
"\n\timpact parameter: " << track->d0()
162 <<
"\n\tcharge: " << track->charge()
163 <<
"\n\tnormalizedChi2: " << track->normalizedChi2()
164 <<
"\n\tFrom EXTRA : "
165 <<
"\n\t\touter PT "<< track->outerPt()<<std::endl;
172 LogTrace(
"SiStripQualityHotStripIdentifier") <<
"\t\t Invalid Hit "<<std::endl;
181 vPSiStripCluster.insert((
void *)&*(matchedHit->
monoHit()->
cluster()));
183 }
else if(projectedHit){
185 }
else if(singleHit){
186 vPSiStripCluster.insert((
void*)&*(singleHit->
cluster()));
188 LogTrace(
"SiStripQualityHotStripIdentifier") <<
"NULL hit" << std::endl;
194 std::stringstream ss;
197 for (; DSViter!=dsv_SiStripCluster->end();DSViter++){
200 for(; ClusIter!=ClusIterEnd; ++ClusIter) {
202 if (
std::find(vPSiStripCluster.begin(),vPSiStripCluster.end(),(
void*) &*ClusIter) == vPSiStripCluster.end()){
204 ss <<
" adding cluster to histo for detid " << DSViter->id <<
" with barycenter "<< ClusIter->barycenter() << std::endl;
205 fillHisto(DSViter->id,ClusIter->barycenter());
210 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 > &)
const SiStripRecHit2D * stereoHit() const
std::vector< Track > TrackCollection
collection of Tracks
const edm::ParameterSet conf_
tuple SiStripDetInfoFileReader
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 &)
const std::map< uint32_t, DetInfo > & getAllData() const
tuple obj
Example code starts here #.
RegistryIterator getRegistryVectorEnd() 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()
ContainerIterator getDataVectorBegin() const
ClusterRef const & cluster() const
T const * product() const
RegistryIterator getRegistryVectorBegin() const
SiStripDetInfoFileReader * reader
std::pair< ContainerIterator, ContainerIterator > Range
iterator begin()
Return an iterator to the first DetSet.
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
const SiStripRecHit2D * monoHit() const
const SiStripRecHit2D & originalHit() const
tuple size
Write out results.
void setMinNumEntriesPerStrip(unsigned short m)
void algoAnalyze(const edm::Event &, const edm::EventSetup &)