Public Member Functions | Private Attributes | List of all members
AlignmentVariation Class Reference

#include <AlignmentVariation.h>

Public Member Functions

 AlignmentVariation (std::string quantity, std::string type, std::string version)
 
void SetDisk (std::string disk)
 
void SetUnits (std::string units)
 
void SetTolerance (std::string tolerance)
 
void SetNominalVersion (std::string v)
 
void SetLabel (std::string label)
 
void SetUser (std::string u)
 
void SetNominalUser (std::string u)
 
void SetCV (std::string cv)
 
void SetScaleFactor (double scale_factor)
 
void SetMacroSuffix (std::string macro_suffix)
 
void AddVariation (std::string variation)
 
std::string GetVariedQuantity ()
 
std::string GetLabel ()
 
std::string GetVariationType ()
 
std::vector< std::stringGetVariationNames ()
 
std::string GetUnits ()
 
std::string GetTolerance ()
 
std::string GetNominalHistoFile (std::string beam_mode="nu", std::string loc="LBNEFD", bool fastmc=false)
 
std::vector< std::stringGetVariedHistoFiles (std::string beam_mode="nu", std::string loc="LBNEFD", bool fastmc=false)
 
std::string GetCV ()
 
double GetScaleFactor ()
 
std::string GetUser ()
 
std::string GetMacroSuffix ()
 

Private Attributes

std::string m_variation_type
 
std::string m_quantity_varied
 
std::string m_label
 
std::vector< std::stringm_variation_names
 
std::string m_units
 
std::string m_version
 
std::string m_nominal_version
 
std::string m_user
 
std::string m_nominal_user
 
std::string m_nominal_plist
 
std::string m_nominal_current
 
std::string m_tolerance
 
std::string m_cv
 
std::string m_disk
 
std::string m_macro_suffix
 
double m_scale_factor
 

Detailed Description

Definition at line 6 of file AlignmentVariation.h.

Constructor & Destructor Documentation

AlignmentVariation::AlignmentVariation ( std::string  quantity,
std::string  type,
std::string  version 
)
inline

Definition at line 35 of file AlignmentVariation.h.

37  {
38 
41  m_label = "";
42 
45 
46  m_user = std::getenv("USER");
47  m_nominal_user = std::getenv("USER");
48 
49  m_nominal_plist = "QGSP_BERT";
50  m_nominal_current = "200kA";
51 
52  m_tolerance = "";
53 
54  m_cv = "0";
55 
56  m_scale_factor = 1.0;
57 
58  m_disk = "/lbne/data/";
59 
60  m_macro_suffix = "";
61  }
std::string m_variation_type
std::string m_macro_suffix
quantity
Definition: statistics_t.cc:15
std::string getenv(std::string const &name)
Definition: getenv.cc:15
std::string m_nominal_version
static QCString type
Definition: declinfo.cpp:672
std::string m_nominal_current
std::string m_nominal_user
std::string m_nominal_plist
std::string m_quantity_varied

Member Function Documentation

void AlignmentVariation::AddVariation ( std::string  variation)
inline

Definition at line 104 of file AlignmentVariation.h.

std::string AlignmentVariation::GetCV ( )
inline

Definition at line 216 of file AlignmentVariation.h.

216 { return m_cv; }
std::string AlignmentVariation::GetLabel ( )
inline

Definition at line 112 of file AlignmentVariation.h.

112  {
113  return m_label;
114  }
std::string AlignmentVariation::GetMacroSuffix ( )
inline

Definition at line 222 of file AlignmentVariation.h.

222 { return m_macro_suffix; }
std::string m_macro_suffix
std::string AlignmentVariation::GetNominalHistoFile ( std::string  beam_mode = "nu",
std::string  loc = "LBNEFD",
bool  fastmc = false 
)
inline

Definition at line 132 of file AlignmentVariation.h.

132  {
133 
134  std::string temp_current = m_nominal_current;
135  if(beam_mode=="antinu") temp_current = "-"+m_nominal_current;
136 
137  std::string fmc = "";
138  if(fastmc) fmc="_fastmc";
139 
140  std::string the_file = m_disk+"/users/"+m_nominal_user+"/fluxfiles/g4lbne/"+m_nominal_version;
141 
142  the_file += "/"+m_nominal_plist+"/Nominal/"+temp_current+"/flux/";
143  the_file += "histos_g4lbne_"+m_nominal_version+"_"+m_nominal_plist+"_Nominal_"+temp_current+"_"+loc+fmc+".root";
144 
145  std::cout<<"Nominal file: "<<the_file<<std::endl;
146  return the_file;
147  }
std::string string
Definition: nybbler.cc:12
std::string m_nominal_version
std::string m_nominal_current
std::string m_nominal_user
std::string m_nominal_plist
QTextStream & endl(QTextStream &s)
double AlignmentVariation::GetScaleFactor ( )
inline

Definition at line 218 of file AlignmentVariation.h.

218 { return m_scale_factor; }
std::string AlignmentVariation::GetTolerance ( )
inline

Definition at line 128 of file AlignmentVariation.h.

128  {
129  return m_tolerance;
130  }
std::string AlignmentVariation::GetUnits ( )
inline

Definition at line 124 of file AlignmentVariation.h.

124  {
125  return m_units;
126  }
std::string AlignmentVariation::GetUser ( )
inline

Definition at line 220 of file AlignmentVariation.h.

220 { return m_user; }
std::vector<std::string> AlignmentVariation::GetVariationNames ( )
inline

Definition at line 120 of file AlignmentVariation.h.

120  {
121  return m_variation_names;
122  }
std::vector< std::string > m_variation_names
std::string AlignmentVariation::GetVariationType ( )
inline

Definition at line 116 of file AlignmentVariation.h.

116  {
117  return m_variation_type;
118  }
std::string m_variation_type
std::vector<std::string> AlignmentVariation::GetVariedHistoFiles ( std::string  beam_mode = "nu",
std::string  loc = "LBNEFD",
bool  fastmc = false 
)
inline

Definition at line 149 of file AlignmentVariation.h.

149  {
150 
151  std::string fmc = "";
152  if(fastmc) fmc="_fastmc";
153 
154  std::vector<std::string> the_files;
155 
156  std::cout<<"Looking up flux histograms for variation "<<m_quantity_varied<<" which has type "<<m_variation_type<<std::endl;
157 
158  if(m_variation_type=="shift") {
159 
160  // "shift" type variations don't have multiple variations. Example: baffle scraping involves shifting the nominal flux by a fraction of the flux from the baffle
161 
162  std::string temp_current = m_nominal_current;
163  if(beam_mode=="antinu") temp_current = "-"+m_nominal_current;
164 
165  std::string the_file = m_disk+"/users/"+m_user+"/fluxfiles/g4lbne/"+m_version;
166  the_file += "/"+m_nominal_plist+"/"+m_quantity_varied+m_units+m_macro_suffix+"/"+temp_current+"/flux/";
167  the_file += "histos_g4lbne_"+m_version+"_"+m_nominal_plist+"_"+m_quantity_varied+m_units+m_macro_suffix+"_"+temp_current+"_"+loc+fmc+".root";
168  the_files.push_back(the_file);
169  }
170  else
171  for(unsigned int i = 0; i<m_variation_names.size(); i++) {
173  if(m_variation_type=="current")
175 
176  std::string the_file = m_disk+"/users/"+m_user+"/fluxfiles/g4lbne/"+m_version;
177 
178  if(m_variation_type=="macro") {
179  std::string temp_current = m_nominal_current;
180  if(beam_mode=="antinu") temp_current = "-"+m_nominal_current;
181 
182  the_file += "/"+m_nominal_plist+"/"+variation+"/"+temp_current+"/flux/";
183  the_file += "histos_g4lbne_"+m_version+"_"+m_nominal_plist+"_"+variation+"_"+temp_current+"_"+loc+fmc+".root";
184  }
185  else if(m_variation_type=="current") {
186  std::string current_sign = "";
187  if(beam_mode=="antinu") current_sign = "-";
188 
189  the_file += "/"+m_nominal_plist+"/Nominal/"+current_sign+variation+"/flux/";
190  the_file += "histos_g4lbne_"+m_nominal_version+"_"+m_nominal_plist+"_Nominal_"+current_sign+variation+"_"+loc+fmc+".root";
191  }
192  else if(m_variation_type=="location") {
193  std::string temp_current = m_nominal_current;
194  if(beam_mode=="antinu") temp_current = "-"+m_nominal_current;
195 
196  std::cout<<" i "<<i<<" m_variation_names[i] "<<m_variation_names[i]<<std::endl;
197  std::cout<<"m_quantity_varied "<<m_quantity_varied<<" loc "<<loc<<std::endl;
198  std::string temploc = loc;
199  if(m_quantity_varied.find(loc)==0) {
201  std::cout<<"temploc "<<temploc<<std::endl;
202  }
203  the_file += "/"+m_nominal_plist+"/Nominal/"+temp_current+"/flux/";
204  the_file += "histos_g4lbne_"+m_nominal_version+"_"+m_nominal_plist+"_Nominal_"+temp_current+"_"+temploc+fmc+".root";
205  }
206  else {
207  std::cout<<"Variation type"<<m_variation_type<<" not yet supported"<<std::endl;
208  return the_files;
209  }
210  the_files.push_back(the_file);
211  std::cout<<"varied file "<<the_file<<std::endl;
212  }
213  return the_files;
214  }
std::string string
Definition: nybbler.cc:12
std::string m_variation_type
std::string m_macro_suffix
std::string m_nominal_version
std::vector< std::string > m_variation_names
std::string m_nominal_current
std::string m_nominal_plist
QTextStream & endl(QTextStream &s)
std::string m_quantity_varied
std::string AlignmentVariation::GetVariedQuantity ( )
inline

Definition at line 108 of file AlignmentVariation.h.

108  {
109  return m_quantity_varied;
110  }
std::string m_quantity_varied
void AlignmentVariation::SetCV ( std::string  cv)
inline

Definition at line 92 of file AlignmentVariation.h.

92  {
93  m_cv = cv;
94  }
void AlignmentVariation::SetDisk ( std::string  disk)
inline

Definition at line 63 of file AlignmentVariation.h.

63  {
64  m_disk = disk;
65  }
void AlignmentVariation::SetLabel ( std::string  label)
inline

Definition at line 80 of file AlignmentVariation.h.

80  {
81  m_label = label;
82  }
void AlignmentVariation::SetMacroSuffix ( std::string  macro_suffix)
inline

Definition at line 100 of file AlignmentVariation.h.

100  {
101  m_macro_suffix = macro_suffix;
102  }
std::string m_macro_suffix
void AlignmentVariation::SetNominalUser ( std::string  u)
inline

Definition at line 88 of file AlignmentVariation.h.

88  {
89  m_nominal_user = u;
90  }
std::string m_nominal_user
void AlignmentVariation::SetNominalVersion ( std::string  v)
inline

Definition at line 76 of file AlignmentVariation.h.

76  {
78  }
std::string m_nominal_version
void AlignmentVariation::SetScaleFactor ( double  scale_factor)
inline

Definition at line 96 of file AlignmentVariation.h.

96  {
97  m_scale_factor = scale_factor;
98  }
void AlignmentVariation::SetTolerance ( std::string  tolerance)
inline

Definition at line 72 of file AlignmentVariation.h.

72  {
74  }
double const tolerance
void AlignmentVariation::SetUnits ( std::string  units)
inline

Definition at line 68 of file AlignmentVariation.h.

68  {
69  m_units=units;
70  }
void AlignmentVariation::SetUser ( std::string  u)
inline

Definition at line 84 of file AlignmentVariation.h.

84  {
85  m_user = u;
86  }

Member Data Documentation

std::string AlignmentVariation::m_cv
private

Definition at line 26 of file AlignmentVariation.h.

std::string AlignmentVariation::m_disk
private

Definition at line 28 of file AlignmentVariation.h.

std::string AlignmentVariation::m_label
private

Definition at line 11 of file AlignmentVariation.h.

std::string AlignmentVariation::m_macro_suffix
private

Definition at line 30 of file AlignmentVariation.h.

std::string AlignmentVariation::m_nominal_current
private

Definition at line 22 of file AlignmentVariation.h.

std::string AlignmentVariation::m_nominal_plist
private

Definition at line 21 of file AlignmentVariation.h.

std::string AlignmentVariation::m_nominal_user
private

Definition at line 19 of file AlignmentVariation.h.

std::string AlignmentVariation::m_nominal_version
private

Definition at line 16 of file AlignmentVariation.h.

std::string AlignmentVariation::m_quantity_varied
private

Definition at line 10 of file AlignmentVariation.h.

double AlignmentVariation::m_scale_factor
private

Definition at line 32 of file AlignmentVariation.h.

std::string AlignmentVariation::m_tolerance
private

Definition at line 24 of file AlignmentVariation.h.

std::string AlignmentVariation::m_units
private

Definition at line 13 of file AlignmentVariation.h.

std::string AlignmentVariation::m_user
private

Definition at line 18 of file AlignmentVariation.h.

std::vector<std::string> AlignmentVariation::m_variation_names
private

Definition at line 12 of file AlignmentVariation.h.

std::string AlignmentVariation::m_variation_type
private

Definition at line 8 of file AlignmentVariation.h.

std::string AlignmentVariation::m_version
private

Definition at line 15 of file AlignmentVariation.h.


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