122 APV->isMasked = SiStripQuality_->
IsApvBad(APV->DetId,APV->APVId);
125 float newPreviousGain = gainHandle->
getApvGain(APV->APVId,gainHandle->
getRange(APV->DetId, 1),1);
126 if(APV->PreviousGain!=1 and newPreviousGain!=APV->PreviousGain)
edm::LogWarning(
"SiStripGainPCLWorker")<<
"WARNING: ParticleGain in the global tag changed\n";
127 APV->PreviousGain = newPreviousGain;
129 float newPreviousGainTick = gainHandle->
getApvGain(APV->APVId,gainHandle->
getRange(APV->DetId, 0),0);
130 if(APV->PreviousGainTick!=1 and newPreviousGainTick!=APV->PreviousGainTick){
131 edm::LogWarning(
"SiStripGainPCLWorker")<<
"WARNING: TickMarkGain in the global tag changed\n"<< std::endl
132 <<
" APV->SubDet: "<< APV->SubDet <<
" APV->APVId:" << APV->APVId << std::endl
133 <<
" APV->PreviousGainTick: "<<APV->PreviousGainTick<<
" newPreviousGainTick: "<<newPreviousGainTick<<std::endl;
135 APV->PreviousGainTick = newPreviousGainTick;
205 unsigned int FirstAmplitude=0;
206 for(
unsigned int i=0;
i<(*chargeoverpath).size();
i++){
208 FirstAmplitude+=(*nstrips)[
i];
209 int TI = (*trackindex)[
i];
234 bool Saturation =
false;
235 for(
unsigned int s=0;
s<(*nstrips)[
i];
s++){
236 int StripCharge = (*amplitude)[FirstAmplitude-(*nstrips)[
i]+
s];
240 if(StripCharge>1024){
243 }
else if(StripCharge>254){
247 Charge += StripCharge;
250 }
else if(APV->SubDet>2){
251 Charge = (*charge)[
i];
253 Charge = (*charge)[
i]/265.0;
256 double ClusterChargeOverPath = ( (double) Charge )/(*path)[
i] ;
258 if(
Validation) {ClusterChargeOverPath/=(*gainused)[
i];}
270 <<
" APV->DetId "<< APV->DetId
271 <<
" APV->Index "<< APV->Index
272 <<
" Charge "<< Charge
273 <<
" ClusterChargeOverPath "<< ClusterChargeOverPath
285 }
else if(APV->Eta>0){
290 if(APV->Thickness<0.04){
292 }
else if(APV->Thickness>0.04){
295 }
else if(APV->Eta>0){
296 if(APV->Thickness<0.04){
298 }
else if(APV->Thickness>0.04){
306 <<
" entries in histogram:"<< (
Charge_Vs_Index[elepos])->getTH2S()->GetEntries()
328 auto const &
Det = newBareTkGeomPtr->
dets();
331 <<
" Resetting APV struct"<<std::endl;
333 unsigned int Index=0;
335 for(
unsigned int i=0;
i<
Det.size();
i++){
344 if(!DetUnit)
continue;
347 unsigned int NAPV = Topo.
nstrips()/128;
349 for(
unsigned int j=0;j<NAPV;j++){
350 auto APV = std::make_shared<stAPVGain>();
359 APV->FitWidthErr = -1;
363 APV->PreviousGain = 1;
364 APV->PreviousGainTick = 1;
365 APV->x = DetUnit->position().basicVector().x();
366 APV->y = DetUnit->position().basicVector().y();
367 APV->z = DetUnit->position().basicVector().z();
368 APV->Eta = DetUnit->position().basicVector().eta();
369 APV->Phi = DetUnit->position().basicVector().phi();
370 APV->R = DetUnit->position().basicVector().transverse();
371 APV->Thickness = DetUnit->surface().bounds().thickness();
373 APV->isMasked =
false;
383 for(
unsigned int i=0;
i<
Det.size();
i++){
388 if(!DetUnit)
continue;
391 unsigned int NROCRow = Topo.
nrows()/(80.);
392 unsigned int NROCCol = Topo.
ncolumns()/(52.);
394 for(
unsigned int j=0;j<NROCRow;j++){
395 for(
unsigned int i=0;
i<NROCCol;
i++){
397 auto APV = std::make_shared<stAPVGain>();
401 APV->APVId = (j<<3 |
i);
406 APV->FitWidthErr = -1;
409 APV->PreviousGain = 1;
410 APV->PreviousGainTick = 1;
411 APV->x = DetUnit->position().basicVector().x();
412 APV->y = DetUnit->position().basicVector().y();
413 APV->z = DetUnit->position().basicVector().z();
414 APV->Eta = DetUnit->position().basicVector().eta();
415 APV->Phi = DetUnit->position().basicVector().phi();
416 APV->R = DetUnit->position().basicVector().transverse();
417 APV->Thickness = DetUnit->surface().bounds().thickness();
418 APV->isMasked =
false;
457 edm::LogInfo(
"SiStripGainsPCLWorker") <<
"Setting " << dqm_dir <<
"in DQM and booking histograms for tag " 463 if(stag.size()!=0 && stag[0]!=
'_') stag.insert(0,1,
'_');
std::vector< MonitorElement * > Charge_Vs_PathlengthTOB
const std::vector< double > * chargeoverpath
bool IsApvBad(const uint32_t &detid, const short &apvNb) const
edm::EDGetTokenT< std::vector< double > > gainused_token_
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
const std::vector< int > * trackalgo
virtual int nrows() const =0
edm::EDGetTokenT< std::vector< double > > localdirz_token_
edm::EDGetTokenT< std::vector< bool > > saturation_token_
edm::EDGetTokenT< std::vector< double > > trackchi2ndof_token_
virtual void checkBookAPVColls(const edm::EventSetup &setup)
const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
size_t getNumberOfTags() const
edm::EDGetTokenT< std::vector< float > > trackp_token_
SiStripGainsPCLWorker(const edm::ParameterSet &)
const TrackerGeometry * bareTkGeomPtr_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
const std::vector< bool > * TrigTech
std::string m_calibrationMode
virtual void dqmBeginRun(edm::Run const &, edm::EventSetup const &)
const std::vector< int > * trackindex
const std::vector< float > * trackpt
const std::vector< unsigned int > * rawid
std::vector< std::shared_ptr< stAPVGain > > APVsCollOrdered
const std::vector< unsigned int > * charge
const std::vector< double > * path
const std::vector< bool > * farfromedge
edm::EDGetTokenT< std::vector< unsigned int > > trackhitsvalid_token_
edm::EDGetTokenT< std::vector< unsigned short > > firststrip_token_
edm::EDGetTokenT< std::vector< bool > > farfromedge_token_
edm::EDGetTokenT< std::vector< bool > > overlapping_token_
static float getApvGain(const uint16_t &apv, const SiStripApvGain::Range &range)
std::vector< std::string > dqm_tag_
uint32_t rawId() const
get the raw id
edm::EDGetTokenT< std::vector< unsigned short > > nstrips_token_
const std::vector< double > * tracketa
edm::EDGetTokenT< std::vector< double > > tracketa_token_
const std::vector< double > * localdiry
void addDefault(ParameterSetDescription const &psetDescription)
const std::vector< float > * trackp
const std::vector< bool > * saturation
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
edm::ESHandle< TrackerGeometry > tkGeom_
std::unordered_map< unsigned int, std::shared_ptr< stAPVGain > > APVsColl
MonitorElement * book2S(Args &&...args)
const std::vector< double > * localdirz
const std::vector< double > * trackphi
unsigned int NClusterPixel
std::vector< MonitorElement * > Charge_Vs_PathlengthTIB
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
const std::vector< bool > * overlapping
edm::EDGetTokenT< std::vector< int > > trackindex_token_
const std::vector< double > * localdirx
edm::EDGetTokenT< std::vector< double > > localdirx_token_
edm::EDGetTokenT< std::vector< unsigned int > > charge_token_
std::vector< MonitorElement * > Charge_Vs_PathlengthTECP1
edm::EDGetTokenT< std::vector< double > > trackphi_token_
const std::vector< unsigned short > * firststrip
const std::vector< unsigned int > * trackhitsvalid
void setCurrentFolder(const std::string &fullpath)
std::vector< MonitorElement * > Charge_Vs_PathlengthTECM2
edm::EDGetTokenT< std::vector< float > > trackpt_token_
virtual int nstrips() const =0
edm::Handle< T > connect(const T *&ptr, edm::EDGetTokenT< T > token, const edm::Event &evt)
double MaxTrackChiOverNdf
edm::EDGetTokenT< std::vector< double > > path_token_
virtual int ncolumns() const =0
std::vector< MonitorElement * > Charge_Vs_PathlengthTECM1
const std::vector< unsigned char > * amplitude
unsigned int NClusterStrip
int statCollectionFromMode(const char *tag) const
edm::EDGetTokenT< std::vector< double > > chargeoverpath_token_
const std::vector< double > * trackchi2ndof
edm::EDGetTokenT< std::vector< int > > trackalgo_token_
std::vector< MonitorElement * > Charge_Vs_PathlengthTECP2
edm::EDGetTokenT< std::vector< double > > localdiry_token_
unsigned int MinTrackHits
std::vector< MonitorElement * > Charge_Vs_PathlengthTIDP
edm::EDGetTokenT< std::vector< unsigned char > > amplitude_token_
const std::vector< unsigned short > * nstrips
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
std::vector< MonitorElement * > Charge_Vs_PathlengthTIDM
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::vector< double > * gainused
edm::EDGetTokenT< std::vector< unsigned int > > rawid_token_
std::vector< MonitorElement * > Charge_Vs_Index
const SiStripApvGain::Range getRange(uint32_t detID) const
edm::EDGetTokenT< std::vector< bool > > TrigTech_token_