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];}
272 if(APV->SubDet<=2)
continue;
282 <<
" APV->DetId "<< APV->DetId
283 <<
" APV->Index "<< APV->Index
284 <<
" Charge "<< Charge
285 <<
" ClusterChargeOverPath "<< ClusterChargeOverPath
294 for(
unsigned int s=0;
s<(*nstrips)[
i];
s++){
295 int StripCharge = (*amplitude)[FirstAmplitude-(*nstrips)[
i]+
s];
296 if(StripCharge>1024) StripCharge = 255;
297 else if(StripCharge>254) StripCharge = 254;
298 mCharge1 += StripCharge;
299 mCharge2 += StripCharge;
300 mCharge3 += StripCharge;
301 mCharge4 += StripCharge;
304 mCharge2 *= (*gainused)[
i];
305 mCharge3 *= (*gainusedTick)[
i];
306 mCharge4 *= ( (*gainused)[
i] * (*gainusedTick)[
i]);
308 std::vector<APVGain::APVmon>& v1 =
Charge_1[elepos];
310 for(
unsigned int m=0;
m<cmon1.size();
m++) cmon1[
m]->
Fill(( (
double) mCharge1 )/(*path)[
i]);
312 std::vector<APVGain::APVmon>& v2 =
Charge_2[elepos];
314 for(
unsigned int m=0;
m<cmon2.size();
m++) cmon2[
m]->
Fill(( (
double) mCharge2 )/(*path)[
i]);
316 std::vector<APVGain::APVmon>& v3 =
Charge_3[elepos];
318 for(
unsigned int m=0;
m<cmon3.size();
m++) cmon3[
m]->
Fill(( (
double) mCharge3 )/(*path)[
i]);
320 std::vector<APVGain::APVmon>& v4 =
Charge_4[elepos];
322 for(
unsigned int m=0;
m<cmon4.size();
m++) cmon4[
m]->
Fill(( (
double) mCharge4 )/(*path)[
i]);
339 }
else if(APV->Eta>0){
348 <<
" entries in histogram:"<< (
Charge_Vs_Index[elepos])->getTH2S()->GetEntries()
370 auto const &
Det = newBareTkGeomPtr->
dets();
373 <<
" Resetting APV struct"<<std::endl;
375 unsigned int Index=0;
377 for(
unsigned int i=0;
i<
Det.size();
i++){
386 if(!DetUnit)
continue;
389 unsigned int NAPV = Topo.
nstrips()/128;
391 for(
unsigned int j=0;j<NAPV;j++){
392 auto APV = std::make_shared<stAPVGain>();
401 APV->FitWidthErr = -1;
405 APV->PreviousGain = 1;
406 APV->PreviousGainTick = 1;
407 APV->x = DetUnit->position().basicVector().x();
408 APV->y = DetUnit->position().basicVector().y();
409 APV->z = DetUnit->position().basicVector().z();
410 APV->Eta = DetUnit->position().basicVector().eta();
411 APV->Phi = DetUnit->position().basicVector().phi();
412 APV->R = DetUnit->position().basicVector().transverse();
413 APV->Thickness = DetUnit->surface().bounds().thickness();
415 APV->isMasked =
false;
425 for(
unsigned int i=0;
i<
Det.size();
i++){
430 if(!DetUnit)
continue;
433 unsigned int NROCRow = Topo.
nrows()/(80.);
434 unsigned int NROCCol = Topo.
ncolumns()/(52.);
436 for(
unsigned int j=0;j<NROCRow;j++){
437 for(
unsigned int i=0;
i<NROCCol;
i++){
439 auto APV = std::make_shared<stAPVGain>();
443 APV->APVId = (j<<3 |
i);
448 APV->FitWidthErr = -1;
451 APV->PreviousGain = 1;
452 APV->PreviousGainTick = 1;
453 APV->x = DetUnit->position().basicVector().x();
454 APV->y = DetUnit->position().basicVector().y();
455 APV->z = DetUnit->position().basicVector().z();
456 APV->Eta = DetUnit->position().basicVector().eta();
457 APV->Phi = DetUnit->position().basicVector().phi();
458 APV->R = DetUnit->position().basicVector().transverse();
459 APV->Thickness = DetUnit->surface().bounds().thickness();
460 APV->isMasked =
false;
499 edm::LogInfo(
"SiStripGainsPCLWorker") <<
"Setting " << dqm_dir <<
"in DQM and booking histograms for tag " 505 if(!stag.empty() && stag[0]!=
'_') stag.insert(0,1,
'_');
527 std::vector<float> binXarray;
530 binXarray.push_back( (
float)
a );
534 std::array<float,688> binYarray;
536 double p1 = 0.002113;
537 double p2 = 69.01576;
539 for(
int b=0;
b<687;
b++) {
541 if(y<=902.) y = y + 2.;
542 else y = ( p0 -
log(
exp(p0-p1*y) - p2*p1)) / p1;
544 binYarray[687] = 4000.;
557 for (
unsigned int i=0;
i<hnames.size();
i++){
567 for (
unsigned int i=0;
i<hnames.size();
i++){
577 for (
unsigned int i=0;
i<hnames.size();
i++){
587 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::vector< MonitorElement * > FetchMonitor(std::vector< APVmon >, uint32_t, const TrackerTopology *topo=nullptr)
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_
const std::vector< bool > * TrigTech
int subdetectorPlane(uint32_t, const TrackerTopology *)
std::string m_calibrationMode
const std::vector< int > * trackindex
const std::vector< float > * trackpt
const std::vector< unsigned int > * rawid
std::vector< std::shared_ptr< stAPVGain > > APVsCollOrdered
void analyze(const edm::Event &, const edm::EventSetup &) override
const std::vector< unsigned int > * charge
const std::vector< double > * path
const std::vector< bool > * farfromedge
edm::EDGetTokenT< std::vector< unsigned int > > trackhitsvalid_token_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
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_
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
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
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
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_