ATLAS Offline Software
Loading...
Searching...
No Matches
RtRelationFactory.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRTCond_RtRelationFactory_h
6#define TRTCond_RtRelationFactory_h
7
11
12namespace TRTCond
13{
14
19 {
20 public:
28 static RtRelation* readFromFile(std::istream& is) ;
30 static void writeToFile(std::ostream& os, const RtRelation& rt) ;
31 } ;
32
33 inline RtRelation* RtRelationFactory::readFromFile(std::istream& is) {
34 RtRelation* rt(0) ;
35 int type ;
36 is >> type ;
37 switch(type) {
39 rt = new BasicRtRelation() ;
40 is >> *rt ;
41 break;
43 rt = new BinnedRtRelation() ;
44 is >> *rt ;
45 break;
47 rt = new DinesRtRelation() ;
48 is >> *rt ;
49 break;
50 }
51 return rt ;
52 }
53
54 inline void RtRelationFactory::writeToFile(std::ostream& os, const RtRelation& rt) {
55 int type(-1) ;
56 if( dynamic_cast<const BasicRtRelation*>(&rt) ) type=EBasicRtRelation ;
57 else if( dynamic_cast<const BinnedRtRelation*>(&rt) ) type=EBinnedRtRelation ;
58 else if( dynamic_cast<const DinesRtRelation*>(&rt) ) type=EDinesRtRelation ;
59 os << type << " " << rt ;
60 }
61
62}
63
64
65#endif
Default rt-relation class in the TRT: a 3rd degree polynomial.
Default rt-relation class in the TRT: a 3rd degree polynomial.
RtRelationType
enumerates 3rd deg polynomial coefficients or table
RtRelationFactory()
constructor
static RtRelation * readFromFile(std::istream &is)
read method
static void writeToFile(std::ostream &os, const RtRelation &rt)
write method
Base class for rt-relations in the TRT.
Definition RtRelation.h:27