126 APV->isMasked = SiStripQuality_->
IsApvBad(APV->DetId,APV->APVId);
129 float newPreviousGain = gainHandle->
getApvGain(APV->APVId,gainHandle->
getRange(APV->DetId, 1),1);
130 if(APV->PreviousGain!=1 and newPreviousGain!=APV->PreviousGain)
edm::LogWarning(
"SiStripGainPCLWorker")<<
"WARNING: ParticleGain in the global tag changed\n";
131 APV->PreviousGain = newPreviousGain;
133 float newPreviousGainTick = gainHandle->
getApvGain(APV->APVId,gainHandle->
getRange(APV->DetId, 0),0);
134 if(APV->PreviousGainTick!=1 and newPreviousGainTick!=APV->PreviousGainTick){
135 edm::LogWarning(
"SiStripGainPCLWorker")<<
"WARNING: TickMarkGain in the global tag changed\n"<< std::endl
136 <<
" APV->SubDet: "<< APV->SubDet <<
" APV->APVId:" << APV->APVId << std::endl
137 <<
" APV->PreviousGainTick: "<<APV->PreviousGainTick<<
" newPreviousGainTick: "<<newPreviousGainTick<<std::endl;
139 APV->PreviousGainTick = newPreviousGainTick;
214 unsigned int FirstAmplitude=0;
215 for(
unsigned int i=0;
i<(*chargeoverpath).size();
i++){
217 FirstAmplitude+=(*nstrips)[
i];
218 int TI = (*trackindex)[
i];
243 bool Saturation =
false;
244 for(
unsigned int s=0;
s<(*nstrips)[
i];
s++){
245 int StripCharge = (*amplitude)[FirstAmplitude-(*nstrips)[
i]+
s];
249 if(StripCharge>1024){
252 }
else if(StripCharge>254){
256 Charge += StripCharge;
259 }
else if(APV->SubDet>2){
260 Charge = (*charge)[
i];
262 Charge = (*charge)[
i]/265.0;
265 double ClusterChargeOverPath = ( (double) Charge )/(*path)[
i] ;
267 if(
Validation) {ClusterChargeOverPath/=(*gainused)[
i];}
279 <<
" APV->DetId "<< APV->DetId
280 <<
" APV->Index "<< APV->Index
281 <<
" Charge "<< Charge
282 <<
" ClusterChargeOverPath "<< ClusterChargeOverPath
291 for(
unsigned int s=0;
s<(*nstrips)[
i];
s++){
292 int StripCharge = (*amplitude)[FirstAmplitude-(*nstrips)[
i]+
s];
293 if(StripCharge>1024) StripCharge = 255;
294 else if(StripCharge>254) StripCharge = 254;
295 mCharge1 += StripCharge;
296 mCharge2 += StripCharge;
297 mCharge3 += StripCharge;
298 mCharge4 += StripCharge;
301 mCharge2 *= (*gainused)[
i];
302 mCharge3 *= (*gainusedTick)[
i];
303 mCharge4 *= ( (*gainused)[
i] * (*gainusedTick)[
i]);
305 std::vector<APVGain::APVmon>& v1 =
Charge_1[elepos];
307 for(
unsigned int m=0;
m<cmon1.size();
m++) cmon1[
m]->
Fill(( (
double) mCharge1 )/(*path)[
i]);
309 std::vector<APVGain::APVmon>& v2 =
Charge_2[elepos];
311 for(
unsigned int m=0;
m<cmon2.size();
m++) cmon2[
m]->
Fill(( (
double) mCharge2 )/(*path)[
i]);
313 std::vector<APVGain::APVmon>& v3 =
Charge_3[elepos];
315 for(
unsigned int m=0;
m<cmon3.size();
m++) cmon3[
m]->
Fill(( (
double) mCharge3 )/(*path)[
i]);
317 std::vector<APVGain::APVmon>& v4 =
Charge_4[elepos];
319 for(
unsigned int m=0;
m<cmon4.size();
m++) cmon4[
m]->
Fill(( (
double) mCharge4 )/(*path)[
i]);
336 }
else if(APV->Eta>0){
345 <<
" entries in histogram:"<< (
Charge_Vs_Index[elepos])->getTH2S()->GetEntries()
367 auto const &
Det = newBareTkGeomPtr->
dets();
370 <<
" Resetting APV struct"<<std::endl;
372 unsigned int Index=0;
374 for(
unsigned int i=0;
i<
Det.size();
i++){
383 if(!DetUnit)
continue;
386 unsigned int NAPV = Topo.
nstrips()/128;
388 for(
unsigned int j=0;j<NAPV;j++){
389 auto APV = std::make_shared<stAPVGain>();
398 APV->FitWidthErr = -1;
402 APV->PreviousGain = 1;
403 APV->PreviousGainTick = 1;
404 APV->x = DetUnit->position().basicVector().x();
405 APV->y = DetUnit->position().basicVector().y();
406 APV->z = DetUnit->position().basicVector().z();
407 APV->Eta = DetUnit->position().basicVector().eta();
408 APV->Phi = DetUnit->position().basicVector().phi();
409 APV->R = DetUnit->position().basicVector().transverse();
410 APV->Thickness = DetUnit->surface().bounds().thickness();
412 APV->isMasked =
false;
422 for(
unsigned int i=0;
i<
Det.size();
i++){
427 if(!DetUnit)
continue;
430 unsigned int NROCRow = Topo.
nrows()/(80.);
431 unsigned int NROCCol = Topo.
ncolumns()/(52.);
433 for(
unsigned int j=0;j<NROCRow;j++){
434 for(
unsigned int i=0;
i<NROCCol;
i++){
436 auto APV = std::make_shared<stAPVGain>();
440 APV->APVId = (j<<3 |
i);
445 APV->FitWidthErr = -1;
448 APV->PreviousGain = 1;
449 APV->PreviousGainTick = 1;
450 APV->x = DetUnit->position().basicVector().x();
451 APV->y = DetUnit->position().basicVector().y();
452 APV->z = DetUnit->position().basicVector().z();
453 APV->Eta = DetUnit->position().basicVector().eta();
454 APV->Phi = DetUnit->position().basicVector().phi();
455 APV->R = DetUnit->position().basicVector().transverse();
456 APV->Thickness = DetUnit->surface().bounds().thickness();
457 APV->isMasked =
false;
496 edm::LogInfo(
"SiStripGainsPCLWorker") <<
"Setting " << dqm_dir <<
"in DQM and booking histograms for tag " 502 if(stag.size()!=0 && stag[0]!=
'_') stag.insert(0,1,
'_');
527 for (
unsigned int i=0;
i<hnames.size();
i++){
537 for (
unsigned int i=0;
i<hnames.size();
i++){
547 for (
unsigned int i=0;
i<hnames.size();
i++){
557 for (
unsigned int i=0;
i<hnames.size();
i++){
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_
std::array< std::vector< APVGain::APVmon >, 7 > Charge_1
edm::EDGetTokenT< std::vector< double > > trackchi2ndof_token_
edm::EDGetTokenT< std::vector< double > > gainusedTick_token_
virtual void checkBookAPVColls(const edm::EventSetup &setup)
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
int subdetectorPlane(uint32_t, const TrackerTopology *)
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)
const std::vector< double > * gainusedTick
std::vector< std::string > dqm_tag_
bool doChargeMonitorPerPlane
uint32_t rawId() const
get the raw id
U second(std::pair< T, U > const &p)
edm::EDGetTokenT< std::vector< unsigned short > > nstrips_token_
const std::vector< double > * tracketa
edm::EDGetTokenT< std::vector< double > > tracketa_token_
std::vector< MonitorElement * > FetchMonitor(std::vector< APVmon >, uint32_t, const TrackerTopology *topo=0)
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
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) ...
std::array< std::vector< APVGain::APVmon >, 7 > Charge_4
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
std::array< std::vector< APVGain::APVmon >, 7 > Charge_2
int subdetectorSide(uint32_t, const TrackerTopology *)
edm::Handle< T > connect(const T *&ptr, edm::EDGetTokenT< T > token, const edm::Event &evt)
std::vector< std::string > VChargeHisto
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
std::array< std::vector< APVGain::APVmon >, 7 > Charge_3
unsigned int NClusterStrip
void processEvent(const TrackerTopology *topo)
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_
std::vector< std::pair< std::string, std::string > > monHnames(std::vector< std::string >, bool, const char *tag)
unsigned int MinTrackHits
std::vector< MonitorElement * > Charge_Vs_PathlengthTIDP
edm::EDGetTokenT< std::vector< unsigned char > > amplitude_token_
const std::vector< unsigned short > * nstrips
MonitorElement * book1DD(Args &&...args)
T const * product() const
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
std::vector< MonitorElement * > Charge_Vs_PathlengthTIDM
int subdetectorId(uint32_t)
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_