22 : TNamed(name, title) {}
25 for (
unsigned int i = 0; i <
size(); ++i)
26 (*
this)[i]->set_geometry(geo);
35 ATH_MSG_ERROR(
"now in TFCSParametrizationBase::simulate(). This should "
36 "normally not happen");
54 bool shortprint = opt.Index(
"short") >= 0;
55 bool longprint =
msgLvl(MSG::DEBUG) || (
msgLvl(MSG::INFO) && !shortprint);
56 TString optprint = opt;
57 optprint.ReplaceAll(
"short",
"");
61 ATH_MSG(INFO) << optprint <<
" PDGID: ";
65 for (std::set<int>::iterator it =
pdgid().begin(); it !=
pdgid().end();
67 if (it !=
pdgid().begin())
93 for (
unsigned int i = 0; i <
size(); ++i)
98 auto checkexist = dup.find(param);
99 if (checkexist != dup.end()) {
101 "DUPLICATE POINTER DETECTED");
110 if (checkexist->second.replace) {
113 << refparam <<
"=" << refparam->GetName()
114 <<
", duplicate is " << param <<
"=" << param->GetName()
115 <<
" index " << i <<
" of " <<
this);
116 dup[refparam].mother.push_back(
this);
117 dup[refparam].index.push_back(i);
123 for (
auto &
ref : dup) {
126 if (param == refparam)
129 if (refparam ==
nullptr)
132 if (
ref.second.replace)
135 if (*param == *refparam) {
137 << refparam <<
"=" << refparam->GetName()
138 <<
", duplicate is " << param <<
"=" << param->GetName()
139 <<
" index " << i <<
" of " <<
this);
141 dup[param].replace = refparam;
142 dup[refparam].mother.push_back(
this);
143 dup[refparam].index.push_back(i);
156 std::set<TFCSParametrizationBase *> dellist;
157 for (
auto &dupiter : dupclasses) {
159 for (
auto onedup : dup) {
160 if (onedup.second.mother.empty())
164 for (
unsigned int i = 0; i < onedup.second.mother.size(); ++i) {
165 int index = onedup.second.index[i];
168 unsigned int delcount = dup[delparam].mother.size();
171 << delparam <<
"=" << delparam->GetName() <<
" index "
172 <<
index <<
" of " << mother <<
", has " << delcount
173 <<
" other replacements attached. Deleting");
175 dellist.insert(delparam);
178 << delparam <<
"=" << delparam->GetName() <<
" index "
179 <<
index <<
" of " << mother <<
", has " << delcount
180 <<
" other replacements attached. Skipping");
190 std::map<std::string, int> ndel;
191 for (
auto *delparam : dellist) {
193 bool present = dup2.find(delparam) != dup2.end();
196 << delparam->GetName()
197 <<
" still referenced somewhere!");
200 << delparam->GetName());
201 ++ndel[delparam->ClassName()];
205 for (
auto &del : ndel)
206 ATH_MSG_INFO(
"Deleted " << del.second <<
" duplicate objects of class "
211 for (
unsigned int i = 0; i <
size(); ++i)
223void TFCSParametrizationBase::Copy2GPU() {
224 for (
unsigned int i = 0; i <
size(); ++i) {
228 TString name = param->ClassName();
229 if (name.EqualTo(
"TFCSLateralShapeParametrizationHitChain")) {
231 for (
size_t ichain = 0; ichain <
size; ++ichain) {
234 TString hitsimname = hitsim->ClassName();
235 if (hitsimname.EqualTo(
"TFCSHistoLateralShapeParametrization")) {
237 }
else if (hitsimname.EqualTo(
"TFCSHitCellMappingWiggle")) {
238 (
static_cast<TFCSHitCellMappingWiggle *
>(hitsim))->LoadHistFuncs();
239 }
else if (hitsimname.EqualTo(
"TFCSHistoLateralShapeGausLogWeight")) {
240 (
static_cast<TFCSHistoLateralShapeGausLogWeight *
>(hitsim))->LoadHist();
const boost::regex ref(r_ef)
#define ATH_MSG_WARNING(x)
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
An interface for getting the name of a class as a string.
bool msgLvl(const MSG::Level lvl) const
Check whether the logging system is active at the provided verbosity level.
virtual FCSReturnCode simulate(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const
Method in all derived classes to do some simulation.
void FindDuplicates(FindDuplicateClasses_t &dup)
virtual const std::set< int > & pdgid() const
virtual bool is_match_all_eta() const
virtual bool is_match_all_Ekin() const
virtual double Ekin_min() const
virtual void set_geometry(ICaloGeometry *geo)
Method to set the geometry access pointer.
virtual double eta_max() const
virtual void set_daughter(unsigned int, TFCSParametrizationBase *)
Some derived classes have daughter instances of TFCSParametrizationBase objects The set_daughter meth...
std::map< TFCSParametrizationBase *, Duplicate_t > FindDuplicates_t
virtual unsigned int size() const
Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operat...
virtual double eta_min() const
std::map< std::string, FindDuplicates_t > FindDuplicateClasses_t
virtual double Ekin_max() const
void Print(Option_t *option="") const
Print object information.
virtual bool is_match_all_pdgid() const
bool compare(const TFCSParametrizationBase &ref) const
Do not persistify!
virtual double eta_nominal() const
TFCSParametrizationBase(const char *name=nullptr, const char *title=nullptr)
virtual double Ekin_nominal() const
#define IsA
Declare the TObject style functions.