CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends
edm::ServiceRegistry Class Reference

#include <ServiceRegistry.h>

Classes

class  Operate
 

Public Member Functions

template<typename T >
Tget () const
 
template<typename T >
bool isAvailable () const
 
ServiceRegistry const & operator= (ServiceRegistry const &)=delete
 
ServiceToken presentToken () const
 
 ServiceRegistry (ServiceRegistry const &)=delete
 
virtual ~ServiceRegistry ()
 

Static Public Member Functions

template<typename T >
static ServiceToken createContaining (std::shared_ptr< serviceregistry::ServiceWrapper< T > > iWrapper)
 create a service token that holds the service held by iWrapper More...
 
template<typename T >
static ServiceToken createContaining (std::shared_ptr< serviceregistry::ServiceWrapper< T > > iWrapper, ServiceToken iToken, serviceregistry::ServiceLegacy iLegacy)
 
template<typename T >
static ServiceToken createContaining (std::unique_ptr< T > iService)
 create a service token that holds the service defined by iService More...
 
template<typename T >
static ServiceToken createContaining (std::unique_ptr< T > iService, ServiceToken iToken, serviceregistry::ServiceLegacy iLegacy)
 
static ServiceToken createServicesFromConfig (std::unique_ptr< ParameterSet > params)
 
static ServiceToken createSet (std::vector< ParameterSet > &)
 
static ServiceToken createSet (std::vector< ParameterSet > &, ServiceToken, serviceregistry::ServiceLegacy, bool associate=true)
 
static ServiceRegistryinstance ()
 

Private Member Functions

 ServiceRegistry ()
 
ServiceToken setContext (ServiceToken const &iNewToken)
 
void unsetContext (ServiceToken const &iOldToken)
 

Private Attributes

std::shared_ptr< serviceregistry::ServicesManagermanager_
 

Friends

class edm::FwkImpl
 
int main (int argc, char *argv[])
 
class Operate
 

Detailed Description

Definition at line 38 of file ServiceRegistry.h.

Constructor & Destructor Documentation

◆ ServiceRegistry() [1/2]

edm::ServiceRegistry::ServiceRegistry ( ServiceRegistry const &  )
delete

◆ ~ServiceRegistry()

ServiceRegistry::~ServiceRegistry ( )
virtual

Definition at line 36 of file ServiceRegistry.cc.

36 {}

◆ ServiceRegistry() [2/2]

ServiceRegistry::ServiceRegistry ( )
private

Definition at line 30 of file ServiceRegistry.cc.

30 {}

Member Function Documentation

◆ createContaining() [1/4]

template<typename T >
static ServiceToken edm::ServiceRegistry::createContaining ( std::shared_ptr< serviceregistry::ServiceWrapper< T > >  iWrapper)
inlinestatic

create a service token that holds the service held by iWrapper

Definition at line 118 of file ServiceRegistry.h.

118  {
119  std::vector<edm::ParameterSet> config;
120  auto manager = std::make_shared<serviceregistry::ServicesManager>(config);
121  manager->put(iWrapper);
122  return manager;
123  }

References submitPVResolutionJobs::config.

◆ createContaining() [2/4]

template<typename T >
static ServiceToken edm::ServiceRegistry::createContaining ( std::shared_ptr< serviceregistry::ServiceWrapper< T > >  iWrapper,
ServiceToken  iToken,
serviceregistry::ServiceLegacy  iLegacy 
)
inlinestatic

Definition at line 125 of file ServiceRegistry.h.

127  {
128  std::vector<edm::ParameterSet> config;
129  auto manager = std::make_shared<serviceregistry::ServicesManager>(iToken, iLegacy, config);
130  manager->put(iWrapper);
131  return manager;
132  }

References submitPVResolutionJobs::config.

◆ createContaining() [3/4]

template<typename T >
static ServiceToken edm::ServiceRegistry::createContaining ( std::unique_ptr< T iService)
inlinestatic

create a service token that holds the service defined by iService

Definition at line 99 of file ServiceRegistry.h.

99  {
100  std::vector<edm::ParameterSet> config;
101  auto manager = std::make_shared<serviceregistry::ServicesManager>(config);
102  auto wrapper = std::make_shared<serviceregistry::ServiceWrapper<T> >(std::move(iService));
103  manager->put(wrapper);
104  return manager;
105  }

References submitPVResolutionJobs::config, eostools::move(), and wrapper.

Referenced by edm::ScheduleItems::addCPRandTNS(), and main().

◆ createContaining() [4/4]

template<typename T >
static ServiceToken edm::ServiceRegistry::createContaining ( std::unique_ptr< T iService,
ServiceToken  iToken,
serviceregistry::ServiceLegacy  iLegacy 
)
inlinestatic

Definition at line 107 of file ServiceRegistry.h.

109  {
110  std::vector<edm::ParameterSet> config;
111  auto manager = std::make_shared<serviceregistry::ServicesManager>(iToken, iLegacy, config);
112  auto wrapper = std::make_shared<serviceregistry::ServiceWrapper<T> >(std::move(iService));
113  manager->put(wrapper);
114  return manager;
115  }

References submitPVResolutionJobs::config, eostools::move(), and wrapper.

◆ createServicesFromConfig()

ServiceToken ServiceRegistry::createServicesFromConfig ( std::unique_ptr< ParameterSet params)
static

Definition at line 69 of file ServiceRegistry.cc.

69  {
70  auto serviceSets = params->popVParameterSet(std::string("services"));
71  //create the services
72  return ServiceToken(ServiceRegistry::createSet(serviceSets));
73  }

References createSet(), CalibrationSummaryClient_cfi::params, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ createSet() [1/2]

ServiceToken ServiceRegistry::createSet ( std::vector< ParameterSet > &  iPS)
static

Definition at line 75 of file ServiceRegistry.cc.

75  {
76  using namespace serviceregistry;
77  auto returnValue = std::make_shared<ServicesManager>(iPS);
78  return ServiceToken(returnValue);
79  }

Referenced by createServicesFromConfig(), cond::payloadInspector::PlotBase::exec_process(), edm::ScheduleItems::initServices(), and cond::Utilities::run().

◆ createSet() [2/2]

ServiceToken ServiceRegistry::createSet ( std::vector< ParameterSet > &  iPS,
ServiceToken  iToken,
serviceregistry::ServiceLegacy  iLegacy,
bool  associate = true 
)
static

Definition at line 81 of file ServiceRegistry.cc.

84  {
85  using namespace serviceregistry;
86  auto returnValue = std::make_shared<ServicesManager>(iToken, iLegacy, iPS, associate);
87  return ServiceToken(returnValue);
88  }

◆ get()

template<typename T >
T& edm::ServiceRegistry::get ( ) const
inline

◆ instance()

ServiceRegistry & ServiceRegistry::instance ( )
static

◆ isAvailable()

template<typename T >
bool edm::ServiceRegistry::isAvailable ( ) const
inline

Definition at line 72 of file ServiceRegistry.h.

72  {
73  if (nullptr == manager_.get()) {
75  "Service"
76  " no ServiceRegistry has been set for this thread");
77  }
78  return manager_->template isAvailable<T>();
79  }

References manager_, edm::errors::NotFound, and edm::Exception::throwThis().

◆ operator=()

ServiceRegistry const& edm::ServiceRegistry::operator= ( ServiceRegistry const &  )
delete

◆ presentToken()

ServiceToken ServiceRegistry::presentToken ( ) const

◆ setContext()

ServiceToken ServiceRegistry::setContext ( ServiceToken const &  iNewToken)
private

Definition at line 52 of file ServiceRegistry.cc.

52  {
53  ServiceToken returnValue(manager_);
54  manager_ = iNewToken.manager_;
55  return returnValue;
56  }

References edm::ServiceToken::manager_, and manager_.

◆ unsetContext()

void ServiceRegistry::unsetContext ( ServiceToken const &  iOldToken)
private

Definition at line 58 of file ServiceRegistry.cc.

58 { manager_ = iOldToken.manager_; }

References edm::ServiceToken::manager_, and manager_.

Referenced by edm::ServiceRegistry::Operate::~Operate().

Friends And Related Function Documentation

◆ edm::FwkImpl

friend class edm::FwkImpl
friend

Definition at line 52 of file ServiceRegistry.h.

◆ main

int main ( int  argc,
char *  argv[] 
)
friend

===============================================================================================================================================================================================


variant2: for each run define phi-averaged A for normalization channel (Dref,16) and then, divide Rijk on it, i.e. get RRijk

eta=27

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=19

eta=17

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=20

eta=19

eta=18

eta=27 L1=1

eta=25 L1=1

eta=23 L1=1

eta=22 L1=1

eta=21 L1=1

eta=29 L1=1

eta=26 L1=1

eta=24 L1=1

eta=20 L1=1

eta=19 L1=1

eta=18 L1=1

eta=17 L1=1

eta=28 L7=1

eta=27 L7=1

eta=25 L7=1

eta=23 L7=1

eta=22 L7=1

eta=21 L7=1

eta=26 L7=1

eta=24 L7=1

eta=20 L7=1

eta=19 L7=1

eta=18 L7=1

eta=17 L7=1

eta=27

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=19

eta=17

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=20

eta=19

eta=18

eta=27 L1=1

eta=25 L1=1

eta=23 L1=1

eta=22 L1=1

eta=21 L1=1

eta=26 L1=1

eta=24 L1=1

eta=20 L1=1

eta=19 L1=1

eta=18 L1=1

eta=17 L1=1

eta=28 L7=1

eta=27 L7=1

eta=25 L7=1

eta=23 L7=1

eta=22 L7=1

eta=21 L7=1

eta=26 L7=1

eta=24 L7=1

eta=20 L7=1

eta=19 L7=1

eta=18 L7=1

eta=17 L7=1

eta=27

eta=28

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

RBX:

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

RBX:

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

RBX:

Prepare maps of good/bad channels:

Prepare maps of good/bad channels:


CALO JETS


PF JETS

Definition at line 1052 of file DMRtrends.cc.

1053  {
1054  if (argc == 1) {
1055  vector<int> IOVlist = {314881, 315257, 315488, 315489, 315506, 316239, 316271, 316361, 316363, 316378, 316456,
1056  316470, 316505, 316569, 316665, 316758, 317080, 317182, 317212, 317295, 317339, 317382,
1057  317438, 317527, 317661, 317664, 318712, 319337, 319460, 320841, 320854, 320856, 320888,
1058  320916, 320933, 320980, 321009, 321119, 321134, 321164, 321261, 321294, 321310, 321393,
1059  321397, 321431, 321461, 321710, 321735, 321773, 321774, 321778, 321820, 321831, 321880,
1060  321960, 322014, 322510, 322603, 323232, 323423, 323472, 323475, 323693, 323794, 323976,
1061  324202, 324206, 324245, 324729, 324764, 324840, 324999, 325097, 325110};
1062  vector<int> pixelupdateruns{316758, 317527, 317661, 317664, 318227, 320377}; //2018
1063  // vector<int> pixelupdateruns {290543, 297281, 298653, 299443, 300389, 301046, 302131, 303790, 303998, 304911, 305898};//2017
1064 
1065  cout << "WARNING: Running function with arguments specified in DMRtrends.cc" << endl
1066  << "If you want to specify the arguments from command line run the macro as follows:" << endl
1067  << "DMRtrends labels pathtoDMRs geometriesandcolourspairs outputdirectory showpixelupdate showlumi FORCE"
1068  << endl;
1069 
1070  //PLEASE READ: for debugging purposes please keep at least one example that works commented.
1071  // Error messages are still a W.I.P. and having a working example available is useful for debugging.
1072  //Example provided for a currently working set of parameters:
1073  DMRtrends(IOVlist,
1074  {"median", "DrmsNR"},
1075  {"minbias"},
1076  "2018",
1077  "/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERALIGN/data/commonValidation/results/adewit/UL18_DMR_MB_eoj_v3/",
1078  {"1-step hybrid", "mid18 rereco", "counter twist"},
1079  {kBlue, kBlack, kGreen + 3},
1080  "/afs/cern.ch/user/a/acardini/commonValidation/results/acardini/DMRs/DMRTrends/test/",
1081  true,
1082  pixelupdateruns,
1083  true,
1084  true);
1085  return 0;
1086  } else if (argc < 12) {
1087  cout << "DMRtrends IOVlist labels Year pathtoDMRs geometriesandcolourspairs outputdirectory pixelupdatelist "
1088  "showpixelupdate showlumi FORCE"
1089  << endl;
1090 
1091  return 1;
1092  }
1093 
1094  TString runlist = argv[1], all_variables = argv[2], all_labels = argv[3], Year = argv[4], pathtoDMRs = argv[5],
1095  geometrieandcolours = argv[6], //name1:title1:color1,name2:title2:color2,name3:title3:color3
1096  outputdirectory = argv[7], pixelupdatelist = argv[8];
1097  bool showpixelupdate = argv[9], showlumi = argv[10], FORCE = argv[11];
1098  TObjArray *vararray = all_variables.Tokenize(",");
1099  vector<string> Variables;
1100  Variables.reserve(vararray->GetEntries());
1101  for (int i = 0; i < vararray->GetEntries(); i++)
1102  Variables.push_back((string)(vararray->At(i)->GetName()));
1103  TObjArray *labelarray = all_labels.Tokenize(",");
1104  vector<string> labels;
1105  labels.reserve(labelarray->GetEntries());
1106  for (int i = 0; i < labelarray->GetEntries(); i++)
1107  labels.push_back((string)(labelarray->At(i)->GetName()));
1108  TObjArray *IOVarray = runlist.Tokenize(",");
1109  vector<int> IOVlist;
1110  IOVlist.reserve(IOVarray->GetEntries());
1111  for (int i = 0; i < IOVarray->GetEntries(); i++)
1112  IOVlist.push_back(stoi(IOVarray->At(i)->GetName()));
1113  vector<int> pixelupdateruns;
1114  TObjArray *PIXarray = pixelupdatelist.Tokenize(",");
1115  pixelupdateruns.reserve(PIXarray->GetEntries());
1116  for (int i = 0; i < PIXarray->GetEntries(); i++)
1117  pixelupdateruns.push_back(stoi(PIXarray->At(i)->GetName()));
1118  vector<string> geometries;
1119  //TO DO: the color is not taken correctly from command line
1120  vector<Color_t> colours;
1121  TObjArray *geometrieandcolourspairs = geometrieandcolours.Tokenize(",");
1122  for (int i = 0; i < geometrieandcolourspairs->GetEntries(); i++) {
1123  TObjArray *geomandcolourvec = TString(geometrieandcolourspairs->At(i)->GetName()).Tokenize(":");
1124  geometries.push_back(geomandcolourvec->At(0)->GetName());
1125  colours.push_back(ColorParser(geomandcolourvec->At(1)->GetName()));
1126  }
1127  DMRtrends(IOVlist,
1128  Variables,
1129  labels,
1130  Year,
1131  pathtoDMRs.Data(),
1132  geometries,
1133  colours,
1134  outputdirectory.Data(),
1135  showpixelupdate,
1136  pixelupdateruns,
1137  showlumi,
1138  FORCE);
1139 
1140  return 0;

◆ Operate

friend class Operate
friend

Definition at line 54 of file ServiceRegistry.h.

Member Data Documentation

◆ manager_

std::shared_ptr<serviceregistry::ServicesManager> edm::ServiceRegistry::manager_
private

Definition at line 142 of file ServiceRegistry.h.

Referenced by get(), isAvailable(), presentToken(), setContext(), and unsetContext().

SummaryClient_cfi.labels
labels
Definition: SummaryClient_cfi.py:61
cmsBatch.argv
argv
Definition: cmsBatch.py:279
mps_fire.i
i
Definition: mps_fire.py:428
dir2webdir.argc
argc
Definition: dir2webdir.py:39
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
ServiceRegistry
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::ServiceRegistry::createSet
static ServiceToken createSet(std::vector< ParameterSet > &)
Definition: ServiceRegistry.cc:75
wrapper
static HepMC::HEPEVT_Wrapper wrapper
Definition: BeamHaloProducer.cc:47
edm::errors::NotFound
Definition: EDMException.h:57
config
Definition: config.py:1
submitPVResolutionJobs.config
config
parse the configuration file
Definition: submitPVResolutionJobs.py:281
edm::ServiceRegistry::manager_
std::shared_ptr< serviceregistry::ServicesManager > manager_
Definition: ServiceRegistry.h:142
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
test_db_connect.runlist
runlist
Definition: test_db_connect.py:20
ServiceToken
eostools.move
def move(src, dest)
Definition: eostools.py:511
TagProbeFitTreeAnalyzer_cfi.Variables
Variables
Definition: TagProbeFitTreeAnalyzer_cfi.py:16
edm::Exception::throwThis
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
Definition: EDMException.cc:83
DMRtrends
void DMRtrends(vector< int > IOVlist, vector< string > Variables={"median", "DrmsNR"}, vector< string > labels={"MB"}, TString Year="2018", string myValidation="/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERALIGN/data/commonValidation/results/acardini/DMRs/", vector< string > geometries={"GT", "SG", "MP pix LBL", "PIX HLS+ML STR fix"}, vector< Color_t > colours={kBlue, kRed, kGreen, kCyan}, TString outputdir="/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERALIGN/data/commonValidation/alignmentObjects/acardini/DMRsTrends/", bool pixelupdate=false, vector< int > pixelupdateruns={314881, 316758, 317527, 318228, 320377}, bool showlumi=false, bool FORCE=false)
Definition: DMRtrends.cc:349