FairRoot/PandaRoot
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PndSensorNameContFact Class Reference

#include <PndSensorNameContFact.h>

Inheritance diagram for PndSensorNameContFact:

Public Member Functions

 PndSensorNameContFact ()
 
 ~PndSensorNameContFact ()
 
FairParSet * createContainer (FairContainer *c)
 
TList * GetSensorParNames ()
 

Private Member Functions

void setAllContainers ()
 
 PndSensorNameContFact (const PndSensorNameContFact &L)
 
PndSensorNameContFactoperator= (const PndSensorNameContFact &)
 
 ClassDef (PndSensorNameContFact, 1)
 

Private Attributes

TList * fSensorParNames
 
std::vector< std::string > fContainerNames
 

Detailed Description

Definition at line 12 of file PndSensorNameContFact.h.

Constructor & Destructor Documentation

PndSensorNameContFact::PndSensorNameContFact ( )

Definition at line 23 of file PndSensorNameContFact.cxx.

References fContainerNames, fSensorParNames, and setAllContainers().

24  // Constructor (called when the library is loaded)
25  fName="PndSensorNameContFact";
26  fTitle="Factory for parameter containers of the PndGeoHandler";
27  fSensorParNames = new TList();
28  fContainerNames.push_back("PndSensorNamePar");
30  FairRuntimeDb::instance()->addContFactory(this);
31 }
std::vector< std::string > fContainerNames
PndSensorNameContFact::~PndSensorNameContFact ( )

Definition at line 32 of file PndSensorNameContFact.cxx.

References fSensorParNames.

32  {
33  if(0!=fSensorParNames)
34  {
35  fSensorParNames->Delete();
36  delete fSensorParNames;
37  }
38 }
PndSensorNameContFact::PndSensorNameContFact ( const PndSensorNameContFact L)
private

Member Function Documentation

PndSensorNameContFact::ClassDef ( PndSensorNameContFact  ,
 
)
private
FairParSet * PndSensorNameContFact::createContainer ( FairContainer *  c)

Calls the constructor of the corresponding parameter container. For an actual context, which is not an empty string and not the default context of this container, the name is concatinated with the context.

Definition at line 52 of file PndSensorNameContFact.cxx.

References fContainerNames, i, name, and p.

52  {
56  const char* name=c->GetName();
57  FairParSet* p=NULL;
58 
59  for (unsigned int i = 0; i < fContainerNames.size(); i++){
60  if (strcmp(name,fContainerNames[i].c_str())==0) {
61  p=new PndSensorNamePar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
62  return p;
63  }
64  }
65  return p;
66 }
Double_t p
Definition: anasim.C:58
Int_t i
Definition: run_full.C:25
std::vector< std::string > fContainerNames
TString name
Unique match between SensorID and path in TGeoManager.
TList* PndSensorNameContFact::GetSensorParNames ( )
inline

Definition at line 17 of file PndSensorNameContFact.h.

References fSensorParNames.

17 {return fSensorParNames;};
PndSensorNameContFact& PndSensorNameContFact::operator= ( const PndSensorNameContFact )
inlineprivate

Definition at line 24 of file PndSensorNameContFact.h.

24 {return *this;}
void PndSensorNameContFact::setAllContainers ( )
private

Creates the Container objects with all accepted contexts and adds them to the list of containers for the MVD library.

Definition at line 41 of file PndSensorNameContFact.cxx.

References fContainerNames, fSensorParNames, i, and p.

Referenced by PndSensorNameContFact().

41  {
44  for (unsigned int i = 0; i < fContainerNames.size(); i++){
45  std::string description = "Match between GeoManager path and SensorId";
46  FairContainer* p = new FairContainer(fContainerNames[i].c_str(), description.c_str(), "TestDefaultContext");
47  fSensorParNames->Add(new TObjString(p->getConcatName()));
48  containers->Add(p);
49  }
50 }
Double_t p
Definition: anasim.C:58
Int_t i
Definition: run_full.C:25
std::vector< std::string > fContainerNames

Member Data Documentation

std::vector<std::string> PndSensorNameContFact::fContainerNames
private
TList* PndSensorNameContFact::fSensorParNames
private

The documentation for this class was generated from the following files: