NCBeam::Info Class Reference

#include <NCBeam.h>

List of all members.

Public Member Functions

 Info ()
 Default constructor forced on me by ROOT - do not use.
 Info (BeamType::BeamType_t, NC::RunUtil::ERunType)
virtual ~Info ()
bool operator== (const Info &i) const
bool operator< (const Info &i) const
void SetSystShifts (bool *adjustedPars, double *parShifts)
void SetSystShifts (const std::vector< NCType::EFitParam > &adjustedPars, const std::vector< double > &parShifts)
void GetSystShifts (std::vector< NCType::EFitParam > &adjustedPars, std::vector< double > &parShifts) const
TString GetDescription () const
bool IsNominal () const
bool IsShifted (NCType::EFitParam param, double *val=0) const
NC::RunUtil::ERunType GetRunType () const
BeamType::BeamType_t GetBeamType () const

Protected Member Functions

 ClassDef (NCBeam::Info, 2)

Protected Attributes

BeamType::BeamType_t beamType
NC::RunUtil::ERunType runType
std::vector< NCType::EFitParamadjustedPars
std::vector< double > parShifts

Friends

class NCBeam

Detailed Description

Definition at line 97 of file NCBeam.h.


Constructor & Destructor Documentation

NCBeam::Info::Info (  ) 

Default constructor forced on me by ROOT - do not use.

Definition at line 224 of file NCBeam.cxx.

00224 {}

NCBeam::Info::Info ( BeamType::BeamType_t  bt,
NC::RunUtil::ERunType  rt 
)

BeamType is reduced down to the equivalent without intensity part. The effect of this is to merge all intensities together.

Definition at line 227 of file NCBeam.cxx.

References beamType, BeamType::kL010z000i, BeamType::kL010z000i_i209, BeamType::kL010z000i_i225, BeamType::kL010z000i_i232, BeamType::kL010z000i_i259, BeamType::kL010z000i_i300, BeamType::kL010z000i_i317, BeamType::kL010z000i_i326, BeamType::kL010z000i_i380, BeamType::kL010z185i, BeamType::kL010z185i_i124, BeamType::kL010z185i_i191, BeamType::kL010z185i_i213, BeamType::kL010z185i_i224, BeamType::kL010z185i_i232, BeamType::kL010z185i_i243, BeamType::kL010z185i_i257, BeamType::kL010z185i_i282, BeamType::kL010z185i_i303, and BeamType::kL010z185i_i324.

00228   : runType(rt)
00229 {
00230   beamType = bt;
00231 
00232   switch(beamType){
00233   case BeamType::kL010z185i_i124:
00234   case BeamType::kL010z185i_i191:
00235   case BeamType::kL010z185i_i213:
00236   case BeamType::kL010z185i_i224:
00237   case BeamType::kL010z185i_i232:
00238   case BeamType::kL010z185i_i243:
00239   case BeamType::kL010z185i_i257:
00240   case BeamType::kL010z185i_i282:
00241   case BeamType::kL010z185i_i303:
00242   case BeamType::kL010z185i_i324:
00243     beamType = BeamType::kL010z185i;
00244     break;
00245   case BeamType::kL010z000i_i209:
00246   case BeamType::kL010z000i_i225:
00247   case BeamType::kL010z000i_i232:
00248   case BeamType::kL010z000i_i259:
00249   case BeamType::kL010z000i_i300:
00250   case BeamType::kL010z000i_i317:
00251   case BeamType::kL010z000i_i326:
00252   case BeamType::kL010z000i_i380:
00253     beamType = BeamType::kL010z000i;
00254     break;
00255   default:
00256     break;
00257   }
00258 }

NCBeam::Info::~Info (  )  [virtual]

Definition at line 260 of file NCBeam.cxx.

00261 {
00262 }


Member Function Documentation

NCBeam::Info::ClassDef ( NCBeam::Info  ,
 
) [protected]
BeamType::BeamType_t NCBeam::Info::GetBeamType (  )  const [inline]

Definition at line 122 of file NCBeam.h.

References beamType.

Referenced by NCExtrapolationModule::AddFilesToChain(), and NCPOTCounter::GetListOfFiles().

00122 { return beamType; }

TString NCBeam::Info::GetDescription (  )  const

Definition at line 346 of file NCBeam.cxx.

References adjustedPars, bfld::AsString(), beamType, Plot::Format(), NCType::kParams, NC::RunUtil::kRunAll, NC::RunUtil::kRunI, NC::RunUtil::kRunII, NC::RunUtil::kRunIII, n, parShifts, and runType.

Referenced by NCExtrapolationPID::AddEvent(), NCExtrapolationBeamMatrix::DoneFilling(), NCExtrapolationPID::DoneFillingOneBeam(), NCExtrapolationBeamMatrix::DoUnoscTrueToRecoFD(), NCExtrapolationBeamMatrix::FillDataMCHistogramsNear(), NCBeam::FillResultHistograms(), NCExtrapolation::GetBeam(), NCBeam::Init(), NCExtrapolation::InitializeInterpolator(), operator<<(), and NCExtrapolationBeamMatrix::WriteResources().

00347 {
00348   TString ret = BeamType::AsString(beamType);
00349   ret += " ";
00350   switch(runType){
00351   case NC::RunUtil::kRunAll: ret += "All Runs"; break;
00352   case NC::RunUtil::kRunI: ret += "Run I"; break;
00353   case NC::RunUtil::kRunII: ret += "Run II"; break;
00354   case NC::RunUtil::kRunIII: ret += "Run III"; break;
00355   default: ret += "UNKNOWN RUN!";
00356   }
00357 
00358   for(unsigned int n = 0; n < adjustedPars.size(); ++n){
00359     ret += " ";
00360     ret += NCType::kParams[adjustedPars[n]].latexName;
00361     ret += " = ";
00362     ret += TString::Format("%f", parShifts[n]);
00363   }
00364 
00365   return ret;
00366 }

NC::RunUtil::ERunType NCBeam::Info::GetRunType (  )  const

Definition at line 387 of file NCBeam.cxx.

References runType.

Referenced by NCPOTCounter::GetListOfFiles(), NCBeam::GetRunType(), and NCExtrapolation::InitializeInterpolator().

00388 {
00389   return runType;
00390 }

void NCBeam::Info::GetSystShifts ( std::vector< NCType::EFitParam > &  adjustedPars,
std::vector< double > &  parShifts 
) const
bool NCBeam::Info::IsNominal (  )  const

Definition at line 369 of file NCBeam.cxx.

References adjustedPars.

00370 {
00371   return adjustedPars.size() == 0;
00372 }

bool NCBeam::Info::IsShifted ( NCType::EFitParam  param,
double *  val = 0 
) const

Definition at line 375 of file NCBeam.cxx.

References adjustedPars, n, and parShifts.

Referenced by NCExtrapolation::SystsAsSigmas().

00376 {
00377   for(unsigned int n = 0; n < adjustedPars.size(); ++n){
00378     if(adjustedPars[n] == param){
00379       if(val) *val = parShifts[n];
00380       return true;
00381     }
00382   }
00383   return false;
00384 }

bool NCBeam::Info::operator< ( const Info i  )  const

Definition at line 286 of file NCBeam.cxx.

References adjustedPars, beamType, COMPARE_BEAMINFO, MuELoss::e, n, parShifts, and runType.

00287 {
00288 #define COMPARE_BEAMINFO(txt) \
00289 if(txt > i.txt) return false; \
00290 if(txt < i.txt) return true;
00291 
00292   COMPARE_BEAMINFO(beamType);
00293   COMPARE_BEAMINFO(runType);
00294 
00295   const int N = adjustedPars.size();
00296   const int M = i.adjustedPars.size();
00297 
00298   if(N < M) return true;
00299   if(N > M) return false;
00300 
00301   for(int n = 0; n < N; ++n){
00302     COMPARE_BEAMINFO(adjustedPars[n]);
00303 
00304     // TODO - comparing doubles, dodgy...
00305     const double eps = 1e-6;
00306     if(TMath::Abs(parShifts[n]-i.parShifts[n]) < eps) continue;
00307     COMPARE_BEAMINFO(parShifts[n]);
00308   }
00309 
00310   // Identical, therefore not less-than
00311   return false;
00312 
00313 #undef COMPARE_BEAMINFO
00314 }

bool NCBeam::Info::operator== ( const Info i  )  const

Definition at line 265 of file NCBeam.cxx.

References adjustedPars, beamType, MuELoss::e, n, parShifts, and runType.

00266 {
00267   if(beamType != i.beamType) return false;
00268   if(runType  != i.runType)  return false;
00269 
00270   const unsigned int N = adjustedPars.size();
00271   const unsigned int M = i.adjustedPars.size();
00272 
00273   if(N != M) return false;
00274 
00275   for(unsigned int n = 0; n < N; ++n){
00276     if(adjustedPars[n] != i.adjustedPars[n]) return false;
00277     // TODO - comparing doubles, dodgy...
00278     const double eps = 1e-6;
00279     if(TMath::Abs(parShifts[n]-i.parShifts[n]) > eps) return false;
00280   }
00281 
00282   return true;
00283 }

void NCBeam::Info::SetSystShifts ( const std::vector< NCType::EFitParam > &  adjustedPars,
const std::vector< double > &  parShifts 
)
Parameters:
adjustedPars Which parameters are shifted - must be sorted
parShifts The values the respective parameters take
void NCBeam::Info::SetSystShifts ( bool *  adjustedPars,
double *  parShifts 
)

This variant is maintained for compatibility with NCEventInfo::SetEventWeight

Definition at line 317 of file NCBeam.cxx.

References adjustedPars, NCType::kNumSystematicParameters, n, and parShifts.

Referenced by NCExtrapolationModule::AddShiftedEventToExtrapolations(), and NCExtrapolationModule::GetMCScaleFactor().

00318 {
00319   adjustedPars.clear();
00320   parShifts.clear();
00321   for(int n = 0; n < NCType::kNumSystematicParameters; ++n){
00322     if(adj[n]){
00323       adjustedPars.push_back(NCType::EFitParam(n));
00324       parShifts.push_back(shift[n]);
00325     }
00326   }
00327 }


Friends And Related Function Documentation

friend class NCBeam [friend]

Definition at line 99 of file NCBeam.h.


Member Data Documentation

Definition at line 126 of file NCBeam.h.

Referenced by GetDescription(), IsNominal(), IsShifted(), operator<(), operator==(), and SetSystShifts().

std::vector<double> NCBeam::Info::parShifts [protected]

Definition at line 127 of file NCBeam.h.

Referenced by GetDescription(), IsShifted(), operator<(), operator==(), and SetSystShifts().

Definition at line 125 of file NCBeam.h.

Referenced by GetDescription(), GetRunType(), operator<(), operator==(), and NCBeam::SetRunType().


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

Generated on 15 Jul 2018 for loon by  doxygen 1.6.1