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
 
ServiceToken presentToken () const
 
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 const & operator= (ServiceRegistry const &)=delete
 
 ServiceRegistry ()
 
 ServiceRegistry (ServiceRegistry const &)=delete
 
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()

ServiceRegistry::~ServiceRegistry ( )
virtual

Definition at line 36 of file ServiceRegistry.cc.

36 {}

◆ ServiceRegistry() [1/2]

ServiceRegistry::ServiceRegistry ( )
private

Definition at line 30 of file ServiceRegistry.cc.

30 {}

◆ ServiceRegistry() [2/2]

edm::ServiceRegistry::ServiceRegistry ( ServiceRegistry const &  )
privatedelete

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 116 of file ServiceRegistry.h.

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

References looper::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 123 of file ServiceRegistry.h.

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

References looper::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 97 of file ServiceRegistry.h.

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

References looper::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 105 of file ServiceRegistry.h.

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

References looper::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 70 of file ServiceRegistry.h.

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

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

◆ operator=()

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

◆ presentToken()

ServiceToken ServiceRegistry::presentToken ( ) const

The token can be passed to another thread in order to have the same services available in the other thread.

Definition at line 63 of file ServiceRegistry.cc.

63 { return manager_; }

References manager_.

Referenced by edm::Worker::doWork(), edm::WorkerManager::processOneOccurrence(), evf::EvFBuildingThrottle::start(), edm::OutputModuleCommunicatorT< T >::writeLumiAsync(), edm::Schedule::writeLumiAsync(), edm::OutputModuleCommunicatorT< T >::writeRunAsync(), and edm::Schedule::writeRunAsync().

◆ 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  for (int i = 0; i < vararray->GetEntries(); i++)
1101  Variables.push_back((string)(vararray->At(i)->GetName()));
1102  TObjArray *labelarray = all_labels.Tokenize(",");
1103  vector<string> labels;
1104  for (int i = 0; i < labelarray->GetEntries(); i++)
1105  labels.push_back((string)(labelarray->At(i)->GetName()));
1106  TObjArray *IOVarray = runlist.Tokenize(",");
1107  vector<int> IOVlist;
1108  for (int i = 0; i < IOVarray->GetEntries(); i++)
1109  IOVlist.push_back(stoi(IOVarray->At(i)->GetName()));
1110  vector<int> pixelupdateruns;
1111  TObjArray *PIXarray = pixelupdatelist.Tokenize(",");
1112  for (int i = 0; i < PIXarray->GetEntries(); i++)
1113  pixelupdateruns.push_back(stoi(PIXarray->At(i)->GetName()));
1114  vector<string> geometries;
1115  //TO DO: the color is not taken correctly from command line
1116  vector<Color_t> colours;
1117  TObjArray *geometrieandcolourspairs = geometrieandcolours.Tokenize(",");
1118  for (int i = 0; i < geometrieandcolourspairs->GetEntries(); i++) {
1119  TObjArray *geomandcolourvec = TString(geometrieandcolourspairs->At(i)->GetName()).Tokenize(":");
1120  geometries.push_back(geomandcolourvec->At(0)->GetName());
1121  colours.push_back(ColorParser(geomandcolourvec->At(1)->GetName()));
1122  }
1123  DMRtrends(IOVlist,
1124  Variables,
1125  labels,
1126  Year,
1127  pathtoDMRs.Data(),
1128  geometries,
1129  colours,
1130  outputdirectory.Data(),
1131  showpixelupdate,
1132  pixelupdateruns,
1133  showlumi,
1134  FORCE);
1135 
1136  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 143 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:355
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
edm::ServiceRegistry::manager_
std::shared_ptr< serviceregistry::ServicesManager > manager_
Definition: ServiceRegistry.h:143
looper.config
config
Definition: looper.py:291
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