ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MuonCalib::CscCalcSlope Class Reference

does calibration of the CSC chambers More...

#include <CscCalcSlope.h>

Inheritance diagram for MuonCalib::CscCalcSlope:
Collaboration diagram for MuonCalib::CscCalcSlope:

Public Member Functions

 CscCalcSlope (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~CscCalcSlope ()=default
 
StatusCode initialize (void)
 basic required functions More...
 
StatusCode execute (void)
 
StatusCode finalize (void)
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode collectEventInfo ()
 event loop functions More...
 
StatusCode calculateParameters ()
 Finalize functions. More...
 
StatusCode writeCalibrationFile ()
 
StatusCode storeGateRecord ()
 
StatusCode makeCalibPoints ()
 Utility functions. More...
 
double calShape (double *x, double *par)
 
StatusCode calOutput0 ()
 
StatusCode calOutput3 ()
 
void outputParameter3 (const CscCalibResultCollection &results, std::ofstream &out)
 
StatusCode fillBitHist (TH1I *bitHist, const uint16_t &val)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

StoreGateSvcm_storeGate
 Services and tools. More...
 
ICscCalibToolm_cscCalibTool
 
ToolHandle< Muon::ICSC_RDO_Decoderm_cscRdoDecoderTool {this,"CscRDODecoder","Muon::CscRDO_Decoder"}
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
IChronoStatSvc * m_chronoSvc
 
SG::ReadCondHandleKey< CscCondDbDatam_readKey {this, "ReadKey", "CscCondDbData", "Key of CscCondDbData"}
 
std::string m_outputFileName
 Parameters input through joboptions. More...
 
std::string m_calOutputVersion
 
double m_minDeltaAdc
 
bool m_dumpAllHists
 
bool m_ignoreDatabaseError
 
bool m_doBitHists
 
std::string m_titlePrefix
 
std::string m_titlePostfix
 
unsigned int m_maxStripHash
 Internally global variables. More...
 
int m_lastPulserLevel
 
DataVector< DataVector< TProfile > > * m_fracProfs
 
DataVector< DataVector< TGraph > > * m_fracGraphs
 
DataVector< TH1I > * m_bitHists
 
std::vector< float > * m_fitReturns
 
TGraph * m_resGraph
 
DataVector< TGraphErrors > * m_calGraphs
 
TProfilem_currentAmpProf
 
std::map< int, TProfile * > * m_ampProfs
 
std::set< int > * m_pulsedChambers
 
int m_eventCnt
 coherent correction array has the corrections to the coherently pulsed channels to get the basic channels More...
 
CscCalibResultCollectionm_slopes
 
CscCalibResultCollectionm_intercepts
 
BipolarFit m_bipolarFit
 
bool m_doBipolarFit
 
double * m_crossTalkFix
 
bool m_doCrossTalkFix
 
std::vector< float > m_dbLevels
 
float * m_peds
 
float * m_noises
 
bool m_pedFile
 
std::string m_pedFileName
 
int m_expectedChamberLayer
 
std::string m_calFitFunc
 
bool m_findPeakTime
 
TProfilem_peakTimeProf
 
CscCalibResultCollectionm_peakTimes
 
bool m_doLinPlot
 
std::string m_cmd_parameters
 
unsigned int m_numBits
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

does calibration of the CSC chambers

Author
lampe.nosp@m.n@ph.nosp@m.ysics.nosp@m..ari.nosp@m.zona..nosp@m.edu

Description

CscCalcSlope is an algorithm that cycles through calibration events and generates the calibration constants. A root file is also generated where the user can view the validity of the constants.

Definition at line 51 of file CscCalcSlope.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ CscCalcSlope()

MuonCalib::CscCalcSlope::CscCalcSlope ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 31 of file CscCalcSlope.cxx.

31  :
32  AthAlgorithm(name,pSvcLocator),
33  m_storeGate(nullptr),
34  m_cscCalibTool(nullptr),
35  m_chronoSvc(nullptr),
36  m_outputFileName("output.cal"),
37  m_dumpAllHists(false),
38  m_maxStripHash(0),
39  m_lastPulserLevel(-999),
40  m_fracProfs(nullptr),
41  m_fracGraphs(nullptr),
42  m_bitHists(nullptr),
43  m_fitReturns(nullptr),
44  m_resGraph(nullptr),
45  m_calGraphs(nullptr),
46  m_currentAmpProf(nullptr),
47  m_ampProfs(nullptr),
48  m_pulsedChambers(nullptr),
49  m_eventCnt(0),
50  m_slopes(nullptr),
51  m_intercepts(nullptr),
52  m_peds(nullptr),
53  m_noises(nullptr),
54  m_peakTimeProf(nullptr),
55  m_peakTimes(nullptr),
56  m_numBits(12)
57  {
58  declareProperty("OutputFile", m_outputFileName = "");
59  declareProperty("IgnoreDatabaseError",m_ignoreDatabaseError = false); //Set to true to ignore database errors
60  declareProperty("TitlePrefix",m_titlePrefix = ""); //Prefix appended to title of histograms and graphs
61  declareProperty("TitlePostfix",m_titlePostfix = ""); //Postfix appended to title of histograms and graphs
62 
63  //test parameters
64  declareProperty("DoBipolarFit", m_doBipolarFit = true);
65  declareProperty("DoCrossTalkFix",m_doCrossTalkFix = true);
66 
67  declareProperty("GetPedFromFile",m_pedFile = false);
68  declareProperty("PedFileName",m_pedFileName = "");
69 
70  declareProperty("ExpectedChamberLayer", m_expectedChamberLayer = 2);
71 
72  declareProperty("DoLinPlot" , m_doLinPlot = false);
73  declareProperty("CalibFitFunction" , m_calFitFunc = "[0] + [1]*10^(x/-20)");
74  declareProperty("MinDeltaAdc",m_minDeltaAdc = 10, "Minimum change in ADC a calgraph needs to drop for a fit lower bound to be set");
75 
76  /*
77  ADC = mC(db) = m*C_max*10^(db/20) + intercept // C_max = maximum charge
78 
79  we divide by c_max later to get m (the function as in m_calFitFunc has
80  [1] = max ADC, so we divide max charge to get
81 
82  since attenuation is negative
83 
84  db = -20 log(ADC+intercept/mC_max)
85 
86  db = -20 log(ADC - intercept / mC_max)
87 
88  (-20 since V^2 gives power disipation)
89 
90  */
91 
92  declareProperty("FindPeakTime", m_findPeakTime = true);
93  declareProperty("DoBitHists", m_doBitHists = true);
94 
95  declareProperty("CalOutputVersion", m_calOutputVersion="03-00");
96 
97  m_crossTalkFix = new double[24];
98  m_crossTalkFix[0] = 1.0322840930;
99  m_crossTalkFix[1] = 1.0422690324;
100  m_crossTalkFix[2] = 1.0235384586;
101  m_crossTalkFix[3] = 1.0183445962;
102  m_crossTalkFix[4] = 1.0151409212;
103  m_crossTalkFix[5] = 1.0152511102;
104  m_crossTalkFix[6] = 1.0103618910;
105  m_crossTalkFix[7] = 1.0113985580;
106  m_crossTalkFix[8] = 1.0040464232;
107  m_crossTalkFix[9] = 1.0049431193;
108  m_crossTalkFix[10] = 0.9997829589;
109  m_crossTalkFix[11] = 1.0003994005;
110  m_crossTalkFix[12] = 0.9826108255;
111  m_crossTalkFix[13] = 0.9850002836;
112  m_crossTalkFix[14] = 0.9831852065;
113  m_crossTalkFix[15] = 0.9826508145;
114  m_crossTalkFix[16] = 0.9804885017;
115  m_crossTalkFix[17] = 0.9811262196;
116  m_crossTalkFix[18] = 0.9784119832;
117  m_crossTalkFix[19] = 0.9777689757;
118  m_crossTalkFix[20] = 0.9704773978;
119  m_crossTalkFix[21] = 0.9738781078;
120  m_crossTalkFix[22] = 0.9710430303;
121  m_crossTalkFix[23] = 0.9743144079;
122  }

◆ ~CscCalcSlope()

MuonCalib::CscCalcSlope::~CscCalcSlope ( )
default

Member Function Documentation

◆ calculateParameters()

StatusCode MuonCalib::CscCalcSlope::calculateParameters ( )
private

Finalize functions.

Definition at line 534 of file CscCalcSlope.cxx.

535  {
536  Chrono chrono(m_chronoSvc,"calculateParameters");
537  StatusCode sc;
538  ATH_MSG_INFO("Calculating calibration constants.");
539 
540  if(!m_ampProfs){
541  ATH_MSG_FATAL("m_ampProfs empty!");
542  return StatusCode::FAILURE;
543  }
544  unsigned int numCalibPoints = m_ampProfs->size();
545  ATH_MSG_INFO("There are " << numCalibPoints << " pulser levels to evaluate.");
546 
547  IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
548 
549  float chargeMax = 530.88; //in fC
550 
551  int crossTalkCnt = 0;
552 
553  for(unsigned int stripHash = 0 ;stripHash <= m_maxStripHash; stripHash++)
554  {
555 
556  if(true)//stripHash < 50 || stripHash%1000 == 0)
557  {
558  ATH_MSG_INFO("Analyzing strip with hash " << stripHash << " out of " << m_maxStripHash);
559  }
560 
561  //**Now tackle slope calculation
562 
563 
564  Identifier id;
565  m_idHelperSvc->cscIdHelper().get_id((IdentifierHash)stripHash,id,&channelContext);
566  int chamberLayer = m_idHelperSvc->cscIdHelper().chamberLayer(id);
567  char orientation = (m_idHelperSvc->cscIdHelper().measuresPhi(id) ? 'Y':'X');
568 
569  int wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(id);
570 
571 
572  int stationName = m_idHelperSvc->cscIdHelper().stationName(id);
573  int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(id);
574  int stationEta = m_idHelperSvc->cscIdHelper().stationEta(id);
575  int stripNumber = m_idHelperSvc->cscIdHelper().strip(id);
576 
577  IdentifierHash chamHash;
578  m_idHelperSvc->cscIdHelper().get_module_hash(id,chamHash);
579 
580  if(chamberLayer != m_expectedChamberLayer)
581  continue;
582 
583  if(m_findPeakTime)
584  {
585  if(m_peakTimeProf->GetBinEntries(stripHash+1)) //See if any peaking times were recorded for strip
586  {
587  float peakt = m_peakTimeProf->GetBinContent(stripHash+1);
588  float peaktError = m_peakTimeProf->GetBinError(stripHash+1);
589  CscCalibResult * peaktResult = new CscCalibResult(stripHash,peakt, peaktError);
590  m_peakTimes->push_back(peaktResult);
591  }
592  }//end if(m_findPeakTime)
593 
594  //Don't find slope for this strip if it is a transverse strip
595  if(orientation != 'X')
596  continue;
597 
598  //For removing plateau's from fit
599  bool foundMin(false);
600  double fitMinX = 0;
601  double fitMaxX = 0;
602  double lastVal = -1;
603  double lastDrop=0;
604  double thisDrop=0;
605 
606 
607  TGraphErrors * calGraph = new TGraphErrors(numCalibPoints); //calGraph will be what the gain will be found on
608  char calName[20],titleSeed[500];
609  sprintf(calName, "calGraph%u",stripHash);
610  sprintf(titleSeed, "Calgraph for eta %d, sector %d, layer %d%c, strip %d",stationEta,(2*stationPhi+50 - stationName),wireLayer,orientation, stripNumber);
611  calGraph->SetName(calName);
612  std::string title = m_titlePrefix + titleSeed + m_titlePostfix;
613  calGraph->SetTitle(title.c_str());
614  calGraph->GetYaxis()->SetTitle("ADC counts");
615  calGraph->GetXaxis()->SetTitle("Attenuation (-db)");
616 
617  ATH_MSG_DEBUG(" Generating " << title);
618 
619  bool isGoodStrip = false;
620 
621  //Loop over all attenuation levels, filling the calGraph with the amplitudes
622  //for this strip
623  ATH_MSG_DEBUG("Number of ampProfs " << m_ampProfs->size());
624  int calPointItr = 0;
625  for(const auto & [pulserLevel, pAmplitudeProfile] : *m_ampProfs)
626  {
627  if(!pAmplitudeProfile){
628  ATH_MSG_FATAL("Failed at accessing ampProf!");
629  return StatusCode::FAILURE;
630  }
631  ATH_MSG_DEBUG("\tLooking for data for pulser level "
632  << pulserLevel);
633 
634  if(pAmplitudeProfile->GetBinEntries(stripHash+1))
635  {
636 
637  ATH_MSG_VERBOSE("\nHave data for strip " << stripHash);
638 
639  isGoodStrip = true;
640 
641 
642  float adcValue = pAmplitudeProfile->GetBinContent(stripHash+1);
643  float adcError = pAmplitudeProfile->GetBinError(stripHash+1);
644  if(m_doCrossTalkFix)
645  {
646  ATH_MSG_VERBOSE("\tCrosstalk fix " << m_crossTalkFix[crossTalkCnt]);
647  adcValue /= m_crossTalkFix[crossTalkCnt];
648  adcError /= m_crossTalkFix[crossTalkCnt];
649  }
650  if(adcError != adcError)
651  adcError = 0.01;
652 
653  float db = m_dbLevels[pulserLevel];
654 
655 
656  float attenValue =0;
657  if(m_doLinPlot)
658  attenValue = 300*std::pow(10,db/20);
659  else
660  attenValue = db;
661 
662  ATH_MSG_DEBUG("\tStoring at db of " << db << " with attenValue " << attenValue << " from pulser level of " << pulserLevel << " and adcValue " << adcValue);
663 
664 
665 
666  //See if the last two drops were far down enough
667  if(!foundMin){
668  thisDrop = lastVal - adcValue;
669  ATH_MSG_DEBUG("\tFinding fit min:"
670  << "\tlastVal = " << lastVal
671  << ";lastDrop " << lastDrop << "; thisDrop " << thisDrop);
672  if(thisDrop > m_minDeltaAdc && lastDrop > m_minDeltaAdc){
673  ATH_MSG_DEBUG("Found fitMin!");
674  foundMin = true;
675  fitMinX = attenValue;
676  }
677  else{
678  //Not enough deltaADC, store this iterations values for the next loop
679  lastDrop = thisDrop;
680  lastVal = adcValue;
681  }
682  }
683 
684  //Use highest attenuation level as fitMaxX
685  if(attenValue > fitMaxX)
686  fitMaxX = attenValue;
687 
688  calGraph->SetPoint(calPointItr,attenValue,adcValue);
689  calGraph->SetPointError(calPointItr,0.01,adcError);
690  calPointItr++;
691  }//done if(entries >0)
692 
693  }//Done ampProfItr loop
694 
695  if(!foundMin && isGoodStrip){
696  ATH_MSG_WARNING("Failed to find minium for " << title);
697  }
698 
699  //***Do a simple fit to calGraph***
700  //Here we only fit the linear part of the plot. m_fitCutoff can be set by user.
701  if(isGoodStrip)
702  {
703  ATH_MSG_INFO("we have a good stripHash at " << stripHash);
704 
705  m_pulsedChambers->insert(chamHash); //Programer note: Only gets filled on x-axis. Probably OK.
706 
707  float slope, slopeError, intercept, interceptError, chiSquared;
708  int ndf;
709  int fitRet=0;
710 
711  //Setup our gain fit function
712  TF1 myFunc("myFunction", m_calFitFunc.c_str(), fitMinX, fitMaxX);
713  myFunc.SetLineColor(kRed);
714  if(m_doLinPlot)
715  {
716  myFunc.SetParameters(0,5);
717  slope = myFunc.GetParameter(1);
718  slopeError = myFunc.GetParError(1);
719  intercept = myFunc.GetParameter(0);
720  interceptError = myFunc.GetParError(0);
721  chiSquared = myFunc.GetChisquare();
722  ndf = myFunc.GetNDF();
723  }
724  else
725  {
726  myFunc.SetParameters(0.1,2000);
727 
728  fitRet = calGraph->Fit(&myFunc,"RV");
729 
730  slope = myFunc.GetParameter(1)/chargeMax;
731  slopeError = myFunc.GetParError(1);
732  intercept = myFunc.GetParameter(0);
733  interceptError = myFunc.GetParError(0);
734  chiSquared = myFunc.GetChisquare();
735  ndf = myFunc.GetNDF();
736  }
737 
738  float invertedSlope;
739  if(std::abs(slope) < 0.00001 || slope == -999) //watch out for slope==0
740  {
741  ATH_MSG_WARNING("Slope invalid ");
742  continue;
743  }
744 
745  invertedSlope = 1/slope;
746 
747  ATH_MSG_ERROR("Inserting calgraph in for hash " << stripHash);
748  (*m_calGraphs)[stripHash] = calGraph;
749 
750  ATH_MSG_DEBUG("StripHash: " << stripHash << "; slope: " <<slope
751  << "; intercept: " << intercept
752  << "; chi^2/ndf: " << chiSquared << "/" << ndf);
753  CscCalibResult * slopeResult = new CscCalibResult(stripHash,invertedSlope,slopeError,chiSquared,ndf);
754  CscCalibResult * interceptResult = new CscCalibResult(stripHash, intercept, interceptError, chiSquared, ndf);
755 
756  m_slopes->push_back(slopeResult);
757  m_intercepts->push_back(interceptResult);
758  (*m_fitReturns)[stripHash] = fitRet;
759 
760  }//end if(isGoodStrip)
761 
762 
763  if(crossTalkCnt == 23)
764  crossTalkCnt = 0;
765  else
766  crossTalkCnt++;
767  ATH_MSG_DEBUG("Looping over next strip...");
768  }//end loop over strips
769  ATH_MSG_INFO("Completed calculating parameters for each strip");
770  return StatusCode::SUCCESS;
771  }//End calculateParameters()

◆ calOutput0()

StatusCode MuonCalib::CscCalcSlope::calOutput0 ( )
private

Definition at line 791 of file CscCalcSlope.cxx.

791  {
792  //***Take conditions data held in summary histograms and print to the calibration file***//
793  ATH_MSG_INFO("Parameters calculated, preparing to outputing to file: " << m_outputFileName);
794  std::ofstream out;
795  out.open(m_outputFileName.c_str());
796  if(!out.is_open())
797  {
798  ATH_MSG_FATAL("Can't open file " << m_outputFileName.c_str() << "for writing");
799  return StatusCode::FAILURE;
800  }
801  //Start by writing file version number (mainly for COOL program to read)
802  out << "00-00 ";
803  //Number of strips we have info for:
804  out << m_slopes->size() << " ";
805  //print out header
806  out << "pslope ";
807  if(m_findPeakTime) out << "peakt ";
808  out << "END_HEADER\n";
809  //Now we loop over each strip's parameters and print them out
810  ATH_MSG_DEBUG("Begining loop over all " << m_maxStripHash << " hash ids.");
811 
812  //form is:
813  //hashID chamber LayerOrientationStrip parametervalue parametervalue
818  if(m_findPeakTime)
819  {
820  peaktItr = m_peakTimes->begin();
821  peaktEnd = m_peakTimes->end();
822  }
823  for(; slopeItr != slopeEnd; ++slopeItr)
824  {
825  if(m_findPeakTime && (peaktItr == peaktEnd) )
826  {
827  ATH_MSG_FATAL("Peaktimes out of sync with slopes. Quiting write.");
828 
829  return StatusCode::FAILURE;
830  }
831 
832  //Output hashId
833  out << (*slopeItr)->hashId();
834 
835  //get id for next few outputs
836  Identifier id;
837  IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
838  m_idHelperSvc->cscIdHelper().get_id((*slopeItr)->hashId(),id, &channelContext);
839 
840  //output chamber #
841  IdentifierHash chamberHash;
842  Identifier chamberId = m_idHelperSvc->cscIdHelper().elementID(id);
843  if(!m_idHelperSvc->cscIdHelper().valid(chamberId))
844  {
845  ATH_MSG_FATAL(chamberId.getString() << " is not a valid id!");
846  ATH_MSG_FATAL("identifier is: " << m_idHelperSvc->cscIdHelper().show_to_string(chamberId));
847  return StatusCode::FAILURE;
848  }
849 
850  m_idHelperSvc->cscIdHelper().get_module_hash(id,chamberHash);
851  out <<" " << chamberHash;
852 
853  //output strip details
854  out << " " << m_idHelperSvc->cscIdHelper().show_to_string(id) << " ";
855 
856  //output parameter values
857  out << " " << (*slopeItr)->value();
858  if(m_findPeakTime) out << " " << (*peaktItr)->value();
859  out << "\n" ; //to improve readability
860  } //end loop over hash Ids
861 
862  out.close(); //done writing
863 
864  return StatusCode::SUCCESS;
865  }//end calOutput0

◆ calOutput3()

StatusCode MuonCalib::CscCalcSlope::calOutput3 ( )
private

Definition at line 921 of file CscCalcSlope.cxx.

921  {
922  std::ofstream out;
923  out.open(m_outputFileName.c_str());
924  if(!out.is_open())
925  {
926  ATH_MSG_ERROR("Can't open file " << m_outputFileName.c_str());
927  return StatusCode::RECOVERABLE;
928  }
929  out << "03-00 <END_HEADER>";
930 
932  out << "\n<END_FILE>";
933  out.close();
934 
935  ATH_MSG_INFO("Successfully opened file " << m_outputFileName);
936 
937  return StatusCode::SUCCESS;
938  }

◆ calShape()

double MuonCalib::CscCalcSlope::calShape ( double *  x,
double *  par 
)
private

◆ collectEventInfo()

StatusCode MuonCalib::CscCalcSlope::collectEventInfo ( )
private

event loop functions

Definition at line 321 of file CscCalcSlope.cxx.

322  {
323  MsgStream mLog( msgSvc(), name() );
324 
325  // apparently not used since code is exited automatically if there is an error
326  // bool thereIsAnError = false;
327 
328  Chrono chrono(m_chronoSvc,"collectEventInfo");
329  ATH_MSG_DEBUG("Collecting event info for event " << m_eventCnt);
330  //Below might need to be changed depending on how we get data
331  const CscRawDataContainer* fullRDO;
332  StatusCode sc_read = m_storeGate->retrieve(fullRDO, "CSCRDO");
333  if (sc_read != StatusCode::SUCCESS)
334  {
335  ATH_MSG_FATAL("Could not find event");
336  return StatusCode::FAILURE;
337  }
338 
340  const CscCondDbData* readCdo{*readHandle};
341 
342  //Loop over RODs (data from 2 chambers), each of which is in
343  //a single CscRawaData collection
344 
345 
346  for(const auto rod:*fullRDO)
347  {
348  if(not rod->empty())
349  {
350 
351  uint16_t pulsedWireLayer = rod->calLayer();
352 
353  int pulserLevel = rod->calAmplitude();
354  ATH_MSG_VERBOSE("Pulser level is " << pulserLevel);
355  if( pulserLevel != m_lastPulserLevel)
356  {
357  ATH_MSG_INFO("New pulser level found. (" << pulserLevel <<").");
358 
359  std::map<int,TProfile*>::iterator alreadyExistingProfile = m_ampProfs->find(pulserLevel);
360 
361  if(alreadyExistingProfile == m_ampProfs->end())
362  {//No previous profile for this amplitude exists
363 
364  ATH_MSG_DEBUG(" creating new amplitude profile");
365  std::stringstream name, title;
366  name << "ampProf_" << pulserLevel;
367  title << m_titlePrefix << "Amplitudes For Pulser Level " << pulserLevel << m_titlePostfix;
368  m_currentAmpProf = new TProfile(name.str().c_str(), title.str().c_str(),
370  m_currentAmpProf->GetXaxis()->SetTitle("Channel (Hash Id)");
371  m_currentAmpProf->GetYaxis()->SetTitle("Amplitude (ADC value)");
372  ATH_MSG_DEBUG("Adding new amplitude profile");
373  m_ampProfs->insert(std::pair<int, TProfile*>( pulserLevel, m_currentAmpProf));
374  }
375  else
376  {
377  ATH_MSG_DEBUG(" using existing amplitude profile");
378  m_currentAmpProf = alreadyExistingProfile->second;
379  }
380 
381  m_lastPulserLevel = pulserLevel;
382  }
383 
384  unsigned int samplingPhase = rod->samplingPhase();
385  uint8_t samplingPeriod = rod->rate(); //sampling period in ns
386 
387 
388  //Loop over strips in rod
389 
390 
391  for(const auto cluster: *rod)
392  {
393  //Note: For a pulser or ped run, the "cluster"
394  //is the size of an entire layer
395  int numStrips = cluster->width();
396  int samplesPerStrip = (cluster->samples()).size()/numStrips;
397 
398  IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
399 
400  for(int stripItr = 0; stripItr <numStrips; stripItr++)
401  {
402  Identifier stripId =m_cscRdoDecoderTool->channelIdentifier(cluster, &m_idHelperSvc->cscIdHelper(), stripItr);
403  IdentifierHash cscChannelHashId;
404  m_idHelperSvc->cscIdHelper().get_channel_hash(stripId, cscChannelHashId);
405  int stripHash = cscChannelHashId;
406  ATH_MSG_VERBOSE("The eta of this strip is: " << m_idHelperSvc->cscIdHelper().stationEta(stripId));
407 
408  int chamberLayer = m_idHelperSvc->cscIdHelper().chamberLayer(stripId);
409  if(chamberLayer != m_expectedChamberLayer)
410  {
411  ATH_MSG_FATAL("Cluster includes strip in chamber layer "
412  << chamberLayer << ". Only " << m_expectedChamberLayer
413  << " is valid.");
414  return StatusCode::FAILURE;
415  }
416 
417  int currentWireLayer = m_idHelperSvc->cscIdHelper().wireLayer(stripId) - 1;
418  if( currentWireLayer < 0 || currentWireLayer > 3)
419  {
420  ATH_MSG_FATAL("Problem in getting wire layer! - Current value is "
421  << m_idHelperSvc->cscIdHelper().wireLayer(stripId) << " while only values between 1-4 are allowed.");
422  return StatusCode::FAILURE;
423  }
424  bool isThisLayerPulsed = (pulsedWireLayer >> currentWireLayer)&0x1;
425  if(isThisLayerPulsed)
426  {
427 
428  std::vector<uint16_t> samples;
429  cluster->samples(stripItr,samplesPerStrip,samples); //Retrieve samples for a single strip
430 
431  float ped = 0;
432  float noise = 0;
433  if(m_pedFile)
434  {
435  ped = m_peds[stripHash];
436  noise = m_noises[stripHash];
437  }
438  else{
439 
440  if(!readCdo->readChannelPed(stripHash, ped).isSuccess()){
441  ped = 2054;
442  if (m_ignoreDatabaseError) ATH_MSG_WARNING("Failed at getting pedestal from COOL for hash " << stripHash);
443  else ATH_MSG_ERROR("Failed at getting pedestal from COOL for hash " << stripHash);
445  return StatusCode::RECOVERABLE;
446  ATH_MSG_WARNING("Setting to " << ped);
447  }
448  else
449  ATH_MSG_VERBOSE("Got pedestal of " << ped);
450  if(!readCdo->readChannelNoise(stripHash, noise).isSuccess())
451  {
452  noise = .001;
453  if (m_ignoreDatabaseError) ATH_MSG_WARNING("Failed at getting noise from COOL for hash " << stripHash);
454  else ATH_MSG_ERROR("Failed at getting noise from COOL for hash " << stripHash);
456  return StatusCode::FAILURE;
457  ATH_MSG_WARNING("Setting to " << noise);
458  }
459 
460  }
461 
462  double peakAmp{}, peakTime{};
463  int success{};
464  if(!m_doBipolarFit)
465  {
466  //Need to convert vector from ints to floats to pass to findCharge
467  std::vector<float> floatSamples;
468  for(const auto & thisSample:samples){
469 
470  floatSamples.push_back(thisSample-ped);
471  if(m_bitHists){
472  if(!fillBitHist((*m_bitHists)[stripHash],thisSample)){
473  ATH_MSG_WARNING("Failed recording bits for strip " << stripHash);
474  }
475 
476  }
477  }
478 
479  success = m_cscCalibTool->findCharge((float)samplingPeriod, samplingPhase,floatSamples,peakAmp,peakTime);
480 
481  }
482  else
483  {
484  //Need to convert vector from ints to doubles to pass to bipolar fit
485  double adcSamples[4];
486  for(int i = 0; i < 4; i++) adcSamples[i] = samples[i] -ped;
487  double fitResult[3],fitErrors[3], chi2;
488  double width = samplingPeriod == 50 ? 7.2:14.4; //check if 50 or 25ns period
489 
490  m_bipolarFit.Fit(adcSamples,noise,ped,width,fitResult,fitErrors,&chi2);
491  success = true;
492  peakAmp = fitResult[0];
493  peakTime = fitResult[1] - (samplingPhase ? 25 : 0);
494  }//end if m_doBipolarFit
495 
496 
497  if(success)
498  {
499  m_currentAmpProf->Fill(stripHash,peakAmp);
500  //((*m_ampHists)[stripHash])->Fill(peakAmp);
501 
502  if(m_findPeakTime)
503  m_peakTimeProf->Fill(stripHash,peakTime);
504  }
505  else
506  {
507  ATH_MSG_WARNING("Failed at fitting pulse shape. Debug info: ");
508  ATH_MSG_WARNING("stripHash " << stripHash);
509  ATH_MSG_WARNING("strip in chamber " << stripItr);
510  ATH_MSG_WARNING(" and detailed id " << m_idHelperSvc->cscIdHelper().show_to_string(stripId,&channelContext));
511  ATH_MSG_WARNING("Pulsed layer " << pulsedWireLayer<< ", Samples: " << samples[0] <<", " << samples[1] << ", " << samples[2] << ", " << samples[3]);
512  }
513  }//end if (islayerPulsedand and is precision layer)
514  }//end strip loop
515 
516  }//end cluster loop
517  }//end if rod >1
518  }//end rod loop
519 
520 
521  ATH_MSG_DEBUG("end collectEventInfo()");
522  m_eventCnt++;
523 
524  // at this part of the code thereIsAnError is always false - if true it would exit earlier
525  // if(thereIsAnError)
526  // return StatusCode::RECOVERABLE;
527 
528  return StatusCode::SUCCESS;
529  }// end collectEventInfo()

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode MuonCalib::CscCalcSlope::execute ( void  )

Definition at line 261 of file CscCalcSlope.cxx.

262  {
263  ATH_MSG_INFO("Begin execute");
264  //collectEventInfo collects infomation about each event by filling ampHistCollection and peaktHist.
266 
267  if(!sc.isSuccess())
268  {
269  ATH_MSG_WARNING("There was an error collecting information from the RDO this event.");
270  return sc;
271  }
272  ATH_MSG_INFO("End execute");
273  return StatusCode::SUCCESS;
274  } //end execute()

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ fillBitHist()

StatusCode MuonCalib::CscCalcSlope::fillBitHist ( TH1I bitHist,
const uint16_t &  val 
)
inlineprivate

Definition at line 150 of file CscCalcSlope.h.

151  {
152  if(!bitHist)
153  return StatusCode::RECOVERABLE;
154 
155  //Num bits should always be m_numBits
156  std::bitset<12> bitVal(val);
157 
158  for(unsigned int bitIndex = 0; bitIndex < m_numBits; bitIndex++){
159  if(bitVal[bitIndex]){
160  bitHist->Fill(bitIndex);
161  }
162  }
163 
164 
165  return StatusCode::SUCCESS;
166  }

◆ finalize()

StatusCode MuonCalib::CscCalcSlope::finalize ( void  )

m_adcValues and/or m_allPeaktsHist

Definition at line 276 of file CscCalcSlope.cxx.

277  {
278  ATH_MSG_INFO("In finalize()");
279 
280  StatusCode sc;
281 
282  bool thereIsAFatal=false;
283 
284  //calculateParameters() finds means and fits gain curves from the data in
287  if(sc.isFailure())
288  {
289  ATH_MSG_WARNING("Calculation of parameters failed!");
290  }
291  ATH_MSG_DEBUG("Finished calculating parameters");
292 
293  //writeCalibrationFile() writes the calculated parameters into a calibration fie.
295  if(!sc.isSuccess())
296  {
297  ATH_MSG_FATAL("Failed to write parameters to disk!");
298  thereIsAFatal = true; //Not quiting yet to ensure memory is properly deleted
299  }
300 
301  sc = storeGateRecord();
302  if(sc.isFailure())
303  {
304  ATH_MSG_FATAL("Failed to record parameters in StoreGate ");
305  thereIsAFatal = true;
306  }
307 
308  delete m_peakTimeProf;
309 
310  delete [] m_crossTalkFix;
311  ATH_MSG_DEBUG("Finished finalize()");
312 
313  if(thereIsAFatal)
314  return StatusCode::FAILURE;
315 
316  return StatusCode::SUCCESS;
317  }//end finalize()

◆ initialize()

StatusCode MuonCalib::CscCalcSlope::initialize ( void  )

basic required functions

Definition at line 124 of file CscCalcSlope.cxx.

125  {
126  ATH_MSG_INFO("CscCalcSlope::initialize() called");
127 
128  //*******Register services and tools *********/
129  // Store Gate active store
130  ATH_CHECK(serviceLocator()->service("StoreGateSvc", m_storeGate));
131 
132  ATH_CHECK(m_idHelperSvc.retrieve());
133 
134  ATH_CHECK(service("ChronoStatSvc",m_chronoSvc));
135 
136  IToolSvc* toolSvc=nullptr;
137  ATH_CHECK(service("ToolSvc",toolSvc));
138 
139  ATH_CHECK(toolSvc->retrieveTool("CscCalibTool",m_cscCalibTool));
140 
141  ATH_CHECK(m_cscRdoDecoderTool.retrieve());
142 
143  ATH_MSG_INFO("Finished initializing services. ");
144  //*****Initialize internal variables and histograms*******/
145  m_ampProfs = new std::map<int, TProfile* >();
146  //Setup lookup table for pulser levels
147  m_dbLevels.resize(64);
148  for(unsigned int pulserLevel=0; pulserLevel < 64; pulserLevel++)
149  m_dbLevels[pulserLevel] = pulserLevel*.5;
150 
151  IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
152 
154  //Loop through ids to find out what hash range we're working on, and to
155  //initialize histograms.
156  const std::vector<Identifier> & ids = m_idHelperSvc->cscIdHelper().idVector();
157 
158 
159  m_maxStripHash = 0;
160  for(const auto & thisChamberId:ids)
161  {
162  std::vector<Identifier> stripVect;
163  m_idHelperSvc->cscIdHelper().idChannels(thisChamberId,stripVect);
164 
165 
166 
167  for(const auto & thisStripId:stripVect)
168  {
169  IdentifierHash stripHash;
170  m_idHelperSvc->cscIdHelper().get_channel_hash(thisStripId,stripHash);
171 
172  if(m_maxStripHash < (unsigned int)stripHash)
173  m_maxStripHash = (unsigned int)stripHash;
174 
175  if(m_bitHists)
176  {
177  Identifier id;
178  m_idHelperSvc->cscIdHelper().get_id((IdentifierHash)stripHash,id,&channelContext);
179  int wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(id);
180  char orientation = (m_idHelperSvc->cscIdHelper().measuresPhi(id) ? 'Y':'X');
181 
182  int stationName = m_idHelperSvc->cscIdHelper().stationName(id);
183  int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(id);
184  int stationEta = m_idHelperSvc->cscIdHelper().stationEta(id);
185 
186  int stripNumber = m_idHelperSvc->cscIdHelper().strip(id);
187 
188  char bitName[200], titleSeed[500];
189  //Bit histogram (for looking for stuck-bits)
190  sprintf(bitName, "bitHist%d",(int)stripHash);
191  sprintf(titleSeed, "Bit histogram for eta %d, sector %d, layer %d%c strip %d",
192  stationEta,(2*stationPhi+50 - stationName),wireLayer,orientation,stripNumber);
193  std::string title = m_titlePrefix + titleSeed + m_titlePostfix;
194  TH1I* hist = new TH1I(bitName, title.c_str(), m_numBits, 0, m_numBits); //12 bits
195  hist->GetXaxis()->SetTitle("Bit");
196  hist->GetYaxis()->SetTitle("Counts");
198  }
199  }
200  }//end chamber loop
201 
202  m_fitReturns = new std::vector<float>;
203  m_fitReturns->resize(m_maxStripHash+1,0);
204 
206  for(unsigned int chanItr =0; chanItr <= m_maxStripHash; chanItr++)
207  {
208  m_calGraphs->push_back(nullptr);
209  }
210 
211 
212  if(m_pedFile)
213  {
214  ATH_MSG_INFO("Opening pedestal file");
215  std::ifstream in(m_pedFileName.c_str());
216  int stripHash;
217  double ped,noise;//,pedError,noiseError;
218  std::string buff;
219  in >> buff >> buff >> buff >> buff >> buff ;// skip header
220  m_peds = new float[m_maxStripHash+1];
221  m_noises = new float[m_maxStripHash+1];
222 
223  while(!in.eof())
224  {
225  in >> stripHash >> buff >> buff >> ped >> noise;
226  ATH_MSG_INFO(stripHash << "\t" << ped << "\t" << noise);
227  if( stripHash < 0 || (unsigned int) stripHash > m_maxStripHash ) {
228  //cppcheck-suppress shiftNegative
229  ATH_MSG_FATAL("The hash "<< (int) stripHash << " is out of range for the Ped-Vector - Crashing!");
230  return StatusCode::FAILURE;
231  }
232  m_peds[stripHash] = ped;
233  m_noises[stripHash] = noise;
234  }
235  }
236  else
237  {
239  }
240 
241  ATH_MSG_INFO("Counted " << m_maxStripHash +1 << " strips.");
242 
243  m_slopes = new CscCalibResultCollection("pslope");
244  m_intercepts = new CscCalibResultCollection("pinter");
245 
246  if(m_findPeakTime)
247  {
248  m_peakTimeProf = new TProfile("PeakTimes","Peaking Time for each channel",m_maxStripHash+1,
249  0,m_maxStripHash+1);
250  m_peakTimes = new CscCalibResultCollection("peakt");
251  }
252 
253  m_pulsedChambers = new std::set<int>;
254 
255 
256  ATH_MSG_DEBUG("End initialize");
257  return StatusCode::SUCCESS;
258  }//end initialize

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ makeCalibPoints()

StatusCode MuonCalib::CscCalcSlope::makeCalibPoints ( )
private

Utility functions.

◆ msg() [1/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ outputParameter3()

void MuonCalib::CscCalcSlope::outputParameter3 ( const CscCalibResultCollection results,
std::ofstream &  out 
)
private

Definition at line 941 of file CscCalcSlope.cxx.

941  {
942  ATH_MSG_INFO("Printing out parameter " << results.parName());
943 
945  const CscCondDbData* readCdo{*readHandle};
946 
947  out << "\n";
948  out << "<NEW_PAR> " << results.parName() << "\n";
949  std::string idString;
950 
953  for(; resItr != resEnd; ++resItr){
954  unsigned int hashId = (*resItr)->hashId();
955  double value = (*resItr)->value();
956  std::string idString;
957 
958  readCdo->indexToStringId(&m_idHelperSvc->cscIdHelper(), hashId, "CHANNEL", idString).ignore();
959 
960  out << idString << " " << value << "\n";
961  }
962 
963  out << "<END_PAR>" ;
964  }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ storeGateRecord()

StatusCode MuonCalib::CscCalcSlope::storeGateRecord ( )
private

Definition at line 867 of file CscCalcSlope.cxx.

868  {
869  ATH_MSG_INFO("Recording csc calibration report.");
870 
871  StatusCode sc = StatusCode::SUCCESS;
872 
873  bool thereIsAnError = false;
874 
875  std::string histKey = "cscSlopeCalibReport";
876  ATH_MSG_DEBUG("Recording calibration graphs to TDS with key " << histKey);
877 
878  CscCalibReportSlope * report = new CscCalibReportSlope("calGraphs");
879 
880  report->setCalGraphs(m_calGraphs);
881  report->setAmpProfs(m_ampProfs);
882  report->setPulsedChambers(m_pulsedChambers);
883  report->setBitHists(m_bitHists);
884  report->setFitResults(m_fitReturns);
885 
886  CscCalibReportContainer * repCont = new CscCalibReportContainer(histKey);
887  repCont->push_back(report);
888 
889  sc = m_storeGate->record(repCont, histKey);
890  if(sc.isFailure())
891  {
892  ATH_MSG_ERROR("Failed to record CscCalibReportSlope to storegate");
893  thereIsAnError = true;
894  //Since storegate isn't taking ownership, we'll delete it:
895  delete repCont;
896  }
897 
898  CscCalibResultContainer * calibResults
899  = new CscCalibResultContainer("CscCalibResultSlope");
900  calibResults->push_back(m_slopes);
901  calibResults->push_back(m_intercepts);
902  if(m_findPeakTime)
903  calibResults->push_back(m_peakTimes);
904  sc = m_storeGate->record(calibResults,"CscCalibResultSlope");
905  if(sc.isFailure())
906  {
907  ATH_MSG_ERROR("Failed to record results to storegate");
908  thereIsAnError = true;
909  //Since storegate isn't taking ownership, we'll delete it
910  delete calibResults;
911  }
912 
913  if(thereIsAnError)
914  return StatusCode::RECOVERABLE;
915 
916  return StatusCode::SUCCESS;
917  }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

◆ writeCalibrationFile()

StatusCode MuonCalib::CscCalcSlope::writeCalibrationFile ( )
private

Definition at line 774 of file CscCalcSlope.cxx.

775  {
776  Chrono chrono(m_chronoSvc,"writeCalibrationFile");
777  if(m_calOutputVersion == "00-00"){
778  ATH_MSG_INFO("Printing output file version 00-00");
779  return calOutput0();
780  }
781  else if(m_calOutputVersion == "03-00") {
782  ATH_MSG_INFO("Printing output file version 03-00");
783  return calOutput3();
784  }
785  else{
786  ATH_MSG_INFO("Don't know how to write calibration file version " << m_calOutputVersion);
787  return StatusCode::RECOVERABLE;
788  }
789  }

Member Data Documentation

◆ m_ampProfs

std::map<int, TProfile*>* MuonCalib::CscCalcSlope::m_ampProfs
private

Definition at line 110 of file CscCalcSlope.h.

◆ m_bipolarFit

BipolarFit MuonCalib::CscCalcSlope::m_bipolarFit
private

Definition at line 120 of file CscCalcSlope.h.

◆ m_bitHists

DataVector<TH1I>* MuonCalib::CscCalcSlope::m_bitHists
private

Definition at line 104 of file CscCalcSlope.h.

◆ m_calFitFunc

std::string MuonCalib::CscCalcSlope::m_calFitFunc
private

Definition at line 133 of file CscCalcSlope.h.

◆ m_calGraphs

DataVector<TGraphErrors>* MuonCalib::CscCalcSlope::m_calGraphs
private

Definition at line 108 of file CscCalcSlope.h.

◆ m_calOutputVersion

std::string MuonCalib::CscCalcSlope::m_calOutputVersion
private

Definition at line 89 of file CscCalcSlope.h.

◆ m_chronoSvc

IChronoStatSvc* MuonCalib::CscCalcSlope::m_chronoSvc
private

Definition at line 84 of file CscCalcSlope.h.

◆ m_cmd_parameters

std::string MuonCalib::CscCalcSlope::m_cmd_parameters
private

Definition at line 144 of file CscCalcSlope.h.

◆ m_crossTalkFix

double* MuonCalib::CscCalcSlope::m_crossTalkFix
private

Definition at line 122 of file CscCalcSlope.h.

◆ m_cscCalibTool

ICscCalibTool* MuonCalib::CscCalcSlope::m_cscCalibTool
private

Definition at line 81 of file CscCalcSlope.h.

◆ m_cscRdoDecoderTool

ToolHandle<Muon::ICSC_RDO_Decoder> MuonCalib::CscCalcSlope::m_cscRdoDecoderTool {this,"CscRDODecoder","Muon::CscRDO_Decoder"}
private

Definition at line 82 of file CscCalcSlope.h.

◆ m_currentAmpProf

TProfile* MuonCalib::CscCalcSlope::m_currentAmpProf
private

Definition at line 109 of file CscCalcSlope.h.

◆ m_dbLevels

std::vector<float> MuonCalib::CscCalcSlope::m_dbLevels
private

Definition at line 124 of file CscCalcSlope.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doBipolarFit

bool MuonCalib::CscCalcSlope::m_doBipolarFit
private

Definition at line 121 of file CscCalcSlope.h.

◆ m_doBitHists

bool MuonCalib::CscCalcSlope::m_doBitHists
private

Definition at line 95 of file CscCalcSlope.h.

◆ m_doCrossTalkFix

bool MuonCalib::CscCalcSlope::m_doCrossTalkFix
private

Definition at line 123 of file CscCalcSlope.h.

◆ m_doLinPlot

bool MuonCalib::CscCalcSlope::m_doLinPlot
private

Definition at line 141 of file CscCalcSlope.h.

◆ m_dumpAllHists

bool MuonCalib::CscCalcSlope::m_dumpAllHists
private

Definition at line 93 of file CscCalcSlope.h.

◆ m_eventCnt

int MuonCalib::CscCalcSlope::m_eventCnt
private

coherent correction array has the corrections to the coherently pulsed channels to get the basic channels

Definition at line 114 of file CscCalcSlope.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_expectedChamberLayer

int MuonCalib::CscCalcSlope::m_expectedChamberLayer
private

Definition at line 131 of file CscCalcSlope.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_findPeakTime

bool MuonCalib::CscCalcSlope::m_findPeakTime
private

Definition at line 136 of file CscCalcSlope.h.

◆ m_fitReturns

std::vector<float>* MuonCalib::CscCalcSlope::m_fitReturns
private

Definition at line 105 of file CscCalcSlope.h.

◆ m_fracGraphs

DataVector<DataVector<TGraph> >* MuonCalib::CscCalcSlope::m_fracGraphs
private

Definition at line 103 of file CscCalcSlope.h.

◆ m_fracProfs

DataVector<DataVector<TProfile> >* MuonCalib::CscCalcSlope::m_fracProfs
private

Definition at line 102 of file CscCalcSlope.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MuonCalib::CscCalcSlope::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 83 of file CscCalcSlope.h.

◆ m_ignoreDatabaseError

bool MuonCalib::CscCalcSlope::m_ignoreDatabaseError
private

Definition at line 94 of file CscCalcSlope.h.

◆ m_intercepts

CscCalibResultCollection * MuonCalib::CscCalcSlope::m_intercepts
private

Definition at line 116 of file CscCalcSlope.h.

◆ m_lastPulserLevel

int MuonCalib::CscCalcSlope::m_lastPulserLevel
private

Definition at line 100 of file CscCalcSlope.h.

◆ m_maxStripHash

unsigned int MuonCalib::CscCalcSlope::m_maxStripHash
private

Internally global variables.

Definition at line 99 of file CscCalcSlope.h.

◆ m_minDeltaAdc

double MuonCalib::CscCalcSlope::m_minDeltaAdc
private

Definition at line 91 of file CscCalcSlope.h.

◆ m_noises

float * MuonCalib::CscCalcSlope::m_noises
private

Definition at line 126 of file CscCalcSlope.h.

◆ m_numBits

unsigned int MuonCalib::CscCalcSlope::m_numBits
private

Definition at line 147 of file CscCalcSlope.h.

◆ m_outputFileName

std::string MuonCalib::CscCalcSlope::m_outputFileName
private

Parameters input through joboptions.

Definition at line 88 of file CscCalcSlope.h.

◆ m_peakTimeProf

TProfile* MuonCalib::CscCalcSlope::m_peakTimeProf
private

Definition at line 137 of file CscCalcSlope.h.

◆ m_peakTimes

CscCalibResultCollection* MuonCalib::CscCalcSlope::m_peakTimes
private

Definition at line 138 of file CscCalcSlope.h.

◆ m_pedFile

bool MuonCalib::CscCalcSlope::m_pedFile
private

Definition at line 128 of file CscCalcSlope.h.

◆ m_pedFileName

std::string MuonCalib::CscCalcSlope::m_pedFileName
private

Definition at line 129 of file CscCalcSlope.h.

◆ m_peds

float* MuonCalib::CscCalcSlope::m_peds
private

Definition at line 126 of file CscCalcSlope.h.

◆ m_pulsedChambers

std::set<int>* MuonCalib::CscCalcSlope::m_pulsedChambers
private

Definition at line 111 of file CscCalcSlope.h.

◆ m_readKey

SG::ReadCondHandleKey<CscCondDbData> MuonCalib::CscCalcSlope::m_readKey {this, "ReadKey", "CscCondDbData", "Key of CscCondDbData"}
private

Definition at line 85 of file CscCalcSlope.h.

◆ m_resGraph

TGraph* MuonCalib::CscCalcSlope::m_resGraph
private

Definition at line 107 of file CscCalcSlope.h.

◆ m_slopes

CscCalibResultCollection* MuonCalib::CscCalcSlope::m_slopes
private

Definition at line 116 of file CscCalcSlope.h.

◆ m_storeGate

StoreGateSvc* MuonCalib::CscCalcSlope::m_storeGate
private

Services and tools.

Definition at line 80 of file CscCalcSlope.h.

◆ m_titlePostfix

std::string MuonCalib::CscCalcSlope::m_titlePostfix
private

Definition at line 97 of file CscCalcSlope.h.

◆ m_titlePrefix

std::string MuonCalib::CscCalcSlope::m_titlePrefix
private

Definition at line 97 of file CscCalcSlope.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
StoreGateSvc::record
StatusCode record(T *p2BRegistered, const TKEY &key)
Record an object with a key.
MuonCalib::CscCalcSlope::storeGateRecord
StatusCode storeGateRecord()
Definition: CscCalcSlope.cxx:867
covarianceTool.ndf
ndf
Definition: covarianceTool.py:678
get_hdefs.buff
buff
Definition: get_hdefs.py:64
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
MuonCalib::CscCalcSlope::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: CscCalcSlope.h:83
MuonCalib::CscCalcSlope::m_chronoSvc
IChronoStatSvc * m_chronoSvc
Definition: CscCalcSlope.h:84
Muon::nsw::STGTPSegments::moduleIDBits::stationPhi
constexpr uint8_t stationPhi
station Phi 1 to 8
Definition: NSWSTGTPDecodeBitmaps.h:129
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
MuonCalib::CscCalcSlope::m_outputFileName
std::string m_outputFileName
Parameters input through joboptions.
Definition: CscCalcSlope.h:88
MuonCalib::CscCalcSlope::calculateParameters
StatusCode calculateParameters()
Finalize functions.
Definition: CscCalcSlope.cxx:534
MuonCalib::CscCalcSlope::fillBitHist
StatusCode fillBitHist(TH1I *bitHist, const uint16_t &val)
Definition: CscCalcSlope.h:150
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
MuonCalib::CscCalcSlope::m_pulsedChambers
std::set< int > * m_pulsedChambers
Definition: CscCalcSlope.h:111
MuonCalib::CscCalcSlope::m_dbLevels
std::vector< float > m_dbLevels
Definition: CscCalcSlope.h:124
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TH1I
Definition: rootspy.cxx:332
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
MuonCalib::CscCalcSlope::calOutput0
StatusCode calOutput0()
Definition: CscCalcSlope.cxx:791
CscCalibResult
Definition: CscCalibResult.h:19
MuonCalib::CscCalcSlope::outputParameter3
void outputParameter3(const CscCalibResultCollection &results, std::ofstream &out)
Definition: CscCalcSlope.cxx:941
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
plotmaker.hist
hist
Definition: plotmaker.py:148
CaloCondBlobAlgs_fillNoiseFromASCII.db
db
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:43
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
MuonCalib::CscCalcSlope::m_cscCalibTool
ICscCalibTool * m_cscCalibTool
Definition: CscCalcSlope.h:81
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
MuonCalib::CscCalcSlope::writeCalibrationFile
StatusCode writeCalibrationFile()
Definition: CscCalcSlope.cxx:774
checkTP.report
report
Definition: checkTP.py:127
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
MuonCalib::CscCalcSlope::m_expectedChamberLayer
int m_expectedChamberLayer
Definition: CscCalcSlope.h:131
MuonCalib::CscCalcSlope::m_findPeakTime
bool m_findPeakTime
Definition: CscCalcSlope.h:136
MuonCalib::CscCalcSlope::m_peakTimes
CscCalibResultCollection * m_peakTimes
Definition: CscCalcSlope.h:138
athena.value
value
Definition: athena.py:122
CscCalibReportContainer
Definition: CscCalibReportContainer.h:25
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
MuonCalib::CscCalcSlope::m_intercepts
CscCalibResultCollection * m_intercepts
Definition: CscCalcSlope.h:116
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MuonCalib::CscCalcSlope::m_fitReturns
std::vector< float > * m_fitReturns
Definition: CscCalcSlope.h:105
MuonCalib::CscCalcSlope::m_lastPulserLevel
int m_lastPulserLevel
Definition: CscCalcSlope.h:100
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
MuonCalib::CscCalcSlope::m_peds
float * m_peds
Definition: CscCalcSlope.h:126
StoreGateSvc::retrieve
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
MuonCalib::CscCalcSlope::m_bipolarFit
BipolarFit m_bipolarFit
Definition: CscCalcSlope.h:120
MuonCalib::CscCalcSlope::m_fracGraphs
DataVector< DataVector< TGraph > > * m_fracGraphs
Definition: CscCalcSlope.h:103
MuonCalib::CscCalcSlope::m_calFitFunc
std::string m_calFitFunc
Definition: CscCalcSlope.h:133
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MuonCalib::CscCalcSlope::m_pedFileName
std::string m_pedFileName
Definition: CscCalcSlope.h:129
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
lumiFormat.i
int i
Definition: lumiFormat.py:92
python.TrigEgammaMonitorHelper.TProfile
def TProfile(*args, **kwargs)
Definition: TrigEgammaMonitorHelper.py:81
MuonCalib::CscCalcSlope::m_slopes
CscCalibResultCollection * m_slopes
Definition: CscCalcSlope.h:116
MuonCalib::CscCalcSlope::m_doBipolarFit
bool m_doBipolarFit
Definition: CscCalcSlope.h:121
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
MuonCalib::CscCalcSlope::collectEventInfo
StatusCode collectEventInfo()
event loop functions
Definition: CscCalcSlope.cxx:321
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonCalib::CscCalcSlope::m_bitHists
DataVector< TH1I > * m_bitHists
Definition: CscCalcSlope.h:104
01SubmitToGrid.samples
samples
Definition: 01SubmitToGrid.py:58
MuonCalib::CscCalcSlope::m_numBits
unsigned int m_numBits
Definition: CscCalcSlope.h:147
covarianceTool.title
title
Definition: covarianceTool.py:542
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
MuonCalib::CscCalcSlope::m_peakTimeProf
TProfile * m_peakTimeProf
Definition: CscCalcSlope.h:137
MuonCalib::CscCalcSlope::m_calOutputVersion
std::string m_calOutputVersion
Definition: CscCalcSlope.h:89
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonCalib::CscCalcSlope::m_dumpAllHists
bool m_dumpAllHists
Definition: CscCalcSlope.h:93
MuonCalib::CscCalcSlope::calOutput3
StatusCode calOutput3()
Definition: CscCalcSlope.cxx:921
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
MuonCalib::CscCalcSlope::m_noises
float * m_noises
Definition: CscCalcSlope.h:126
RunTileMonitoring.rod
rod
Definition: RunTileMonitoring.py:134
DataVector< TH1I >
MuonCalib::CscCalcSlope::m_storeGate
StoreGateSvc * m_storeGate
Services and tools.
Definition: CscCalcSlope.h:80
MuonCalib::CscCalcSlope::m_doCrossTalkFix
bool m_doCrossTalkFix
Definition: CscCalcSlope.h:123
MuonCalib::CscCalcSlope::m_resGraph
TGraph * m_resGraph
Definition: CscCalcSlope.h:107
CscCalibReportSlope
Definition: CscCalibReportSlope.h:28
CscCalibResultContainer
Definition: CscCalibResultContainer.h:22
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
MuonCalib::CscCalcSlope::m_fracProfs
DataVector< DataVector< TProfile > > * m_fracProfs
Definition: CscCalcSlope.h:102
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
MuonCalib::CscCalcSlope::m_titlePrefix
std::string m_titlePrefix
Definition: CscCalcSlope.h:97
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
MuonCalib::CscCalcSlope::m_readKey
SG::ReadCondHandleKey< CscCondDbData > m_readKey
Definition: CscCalcSlope.h:85
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
python.ami.results
def results
Definition: ami.py:386
MuonCalib::CscCalcSlope::m_cscRdoDecoderTool
ToolHandle< Muon::ICSC_RDO_Decoder > m_cscRdoDecoderTool
Definition: CscCalcSlope.h:82
Example_ReadSampleNoise.ped
ped
Definition: Example_ReadSampleNoise.py:45
IDTPM::chiSquared
float chiSquared(const U &p)
Definition: TrackParametersHelper.h:136
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
ICscCalibTool::findCharge
virtual bool findCharge(const float samplingTime, const unsigned int samplingPhase, const std::vector< float > &samples, double &charge, double &time) const =0
Given sampling values for a CSC strip, find the corresponding charge by fitting the time samples.
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
Identifier::getString
std::string getString() const
Provide a string form of the identifier - hexadecimal.
Definition: Identifier.cxx:25
a
TList * a
Definition: liststreamerinfos.cxx:10
h
TProfile::Fill
int Fill(double, double)
Definition: rootspy.cxx:523
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
CscCalibResultCollection
Definition: CscCalibResultCollection.h:24
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
MuonCalib::CscCalcSlope::m_doLinPlot
bool m_doLinPlot
Definition: CscCalcSlope.h:141
CscRawDataContainer
This container provides access to collections of CSC RDOs and a mechanism for recording them.
Definition: CscRawDataContainer.h:23
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
MuonCalib::CscCalcSlope::m_currentAmpProf
TProfile * m_currentAmpProf
Definition: CscCalcSlope.h:109
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
MuonCalib::CscCalcSlope::m_ignoreDatabaseError
bool m_ignoreDatabaseError
Definition: CscCalcSlope.h:94
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
MuonCalib::CscCalcSlope::m_minDeltaAdc
double m_minDeltaAdc
Definition: CscCalcSlope.h:91
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:127
IdentifierHash
Definition: IdentifierHash.h:38
MuonCalib::CscCalcSlope::m_titlePostfix
std::string m_titlePostfix
Definition: CscCalcSlope.h:97
MuonCalib::CscCalcSlope::m_crossTalkFix
double * m_crossTalkFix
Definition: CscCalcSlope.h:122
BipolarFit::Fit
int Fit(double *x, const double ex, const double pedestal, const double predefinedwidth, double *result, double *errors, double *chi2)
Definition: BipolarFit.cxx:203
IdContext
class IdContext
Definition: IdContext.h:34
MuonCalib::CscCalcSlope::m_maxStripHash
unsigned int m_maxStripHash
Internally global variables.
Definition: CscCalcSlope.h:99
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
MuonCalib::CscCalcSlope::m_eventCnt
int m_eventCnt
coherent correction array has the corrections to the coherently pulsed channels to get the basic chan...
Definition: CscCalcSlope.h:114
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
MuonCalib::CscCalcSlope::m_calGraphs
DataVector< TGraphErrors > * m_calGraphs
Definition: CscCalcSlope.h:108
WriteCellNoiseToCool.noise
noise
Definition: WriteCellNoiseToCool.py:380
MuonCalib::CscCalcSlope::m_pedFile
bool m_pedFile
Definition: CscCalcSlope.h:128
MuonCalib::CscCalcSlope::m_doBitHists
bool m_doBitHists
Definition: CscCalcSlope.h:95
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528
CscCondDbData
Definition: CscCondDbData.h:24
TProfile::GetBinContent
double GetBinContent(int) const
Definition: rootspy.cxx:527
ServiceHandle< ICondSvc >
MuonCalib::CscCalcSlope::m_ampProfs
std::map< int, TProfile * > * m_ampProfs
Definition: CscCalcSlope.h:110