Anp Namespace Reference

Handle class template - a simplified version of boost::intrusive_ptr. More...

Namespaces

namespace  Corr
namespace  Draw
namespace  Fill
namespace  Finder
namespace  Flux
namespace  Plot
namespace  Pmt
namespace  Reco
namespace  Select

Classes

class  AlgAdapt
class  AlgCaddy
class  AlgEvent
class  AlgSnarl
class  AlgStore
class  Basic
class  DataItem
struct  CoordXYZ
class  DrawSnarl
class  DrawSpan
class  EventAdcTab
class  EventDisplay
class  EventHitTab
class  RecordStore
class  SnarlAdcTab
class  SnarlTimeTab
class  StdHepTab
class  Event
class  EventTab
class  Factory
class  FillData
class  FillMuonId
struct  DataNPlane
class  FillNPlane
class  FillSnarl
struct  CountPlaneStrip
struct  CountAboveBelow
class  FillTrackGeom
class  FluxInfo
class  Base
class  Handle
class  Header
class  AxisInfo
class  HistInfo
class  HistMan
class  Bin
class  Hist1d
class  KeyPair
class  AlgThread
struct  PrevDataKey
class  FillkNN
class  RunkNN
class  FitPoint
class  LocalFit
class  FillFlux
class  FillMadId
class  MRCCInfo
class  Lock
class  Mutex
class  CondVar
class  CountHist
class  DataCorr
class  HistBasic
class  PlotBasic
class  PlotData
class  PlotEff
class  PlotEvent
class  HistFlux
class  PlotFlux
class  HistKinem
class  PlotKinem
class  PlotPmt
class  PlotPur
class  PlotResol
class  PlotReson
class  PlotShort
class  PlotShortSelect
class  PlotShower
class  PlotSnarl
class  HistTime
class  PlotTime
class  PlotTrack
class  PlotTrackGeom
class  PlotTruth
class  HistVtx
class  PlotVtx
struct  PlaneHitColl
class  PmtHit
class  ReadTree
class  RecoNu
class  Record
class  RunAlgEvent
class  RunAlgSnarl
class  RunFinder
class  RunModule
class  RunThread
class  FiducialCut
class  SelectAntiNeutrino
class  SelectCount
class  SelectFiducial
class  SelectFlux
class  SelectKinem
class  SelectNC
class  SelectNuMu
class  SelectReson
class  SelectShort
class  SelectSpill
struct  RunSubrun
class  SelectTrue
class  StudyFiducial
class  FillShortEvent
class  FillShortVar
class  StripLink
class  Shower
class  StdHep
class  FillBasic
class  FillEnergy
class  FillEvent
class  FillHeader
class  FillMRCC
class  FillShower
class  FillStrip
class  FillTrack
class  FillTruth
class  Interface
class  RunAlgStore
class  StorekNNData
class  StreamBuf
class  Strip
struct  BySigCor
struct  ByPlaneStrip
class  Track
class  TrueNu
class  Truth
class  TruthReco
class  Vertex

Typedefs

typedef Anp::Handle
< Anp::AlgEvent
AlgEventPtr
typedef Anp::Handle
< Anp::AlgSnarl
AlgSnarlPtr
typedef Anp::Handle
< Anp::AlgStore
AlgStorePtr
typedef DataItem< std::string,
Float_t > 
StringData
typedef DataItem< Short_t,
Float_t > 
Data
typedef std::vector< Anp::DataDataVec
typedef DataVec::const_iterator DataIter
typedef DataVec::iterator DataIterator
typedef Anp::Handle
< Anp::EventTab
EventTabPtr
typedef std::vector
< Anp::TruthReco >
::const_iterator 
TruthRecoIter
typedef std::vector
< Anp::TruthReco >::iterator 
TruthRecoIterator
typedef std::vector
< Anp::Event >::const_iterator 
EventIter
typedef std::vector
< Anp::Track >::const_iterator 
TrackIter
typedef std::vector
< Anp::Truth >::const_iterator 
TruthIter
typedef std::vector
< Anp::Strip >::const_iterator 
StripIter
typedef std::vector
< Anp::Shower >
::const_iterator 
ShowerIter
typedef std::vector
< Anp::StdHep >
::const_iterator 
StdHepIter
typedef std::vector
< Anp::MRCCInfo >
::const_iterator 
MRCCIter
typedef std::vector
< Anp::Event >::iterator 
EventIterator
typedef std::vector
< Anp::Track >::iterator 
TrackIterator
typedef std::vector
< Anp::Truth >::iterator 
TruthIterator
typedef std::vector
< Anp::Strip >::iterator 
StripIterator
typedef std::vector
< Anp::Shower >::iterator 
ShowerIterator
typedef std::vector
< Anp::StdHep >::iterator 
StdHepIterator
typedef std::vector
< Anp::MRCCInfo >::iterator 
MRCCIterator
typedef std::vector< StripIterStripVec
typedef std::vector< TrackIterTrackVec
typedef std::vector< ShowerIterShowerVec
typedef std::vector< MRCCIterMRCCVec

Functions

const std::string ConvertVector2String (const std::vector< double > &dvec)
const std::vector< double > ConvertString2Vector (const std::string &dstr)
template<class T >
const std::string ConvertVectorToString (const std::vector< T > &dvec)
template<class T >
const std::vector< T > ConvertStringToVector (const std::string &dstr)
template<class T >
unsigned int NameWidth (const std::vector< AlgCaddy< T > > &vec)
template<class T >
unsigned int NumbWidth (const std::vector< AlgCaddy< T > > &vec)
template<class K , class D >
bool operator< (const DataItem< K, D > &lhs, const DataItem< K, D > &rhs)
template<class K , class D >
bool operator< (const DataItem< K, D > &lhs, const K &rhs)
template<class K , class D >
bool operator< (const K &lhs, const DataItem< K, D > &rhs)
template<class K , class D >
bool operator== (const DataItem< K, D > &lhs, const DataItem< K, D > &rhs)
template<class K , class D >
bool operator== (const DataItem< K, D > &lhs, const K &rhs)
template<class K , class D >
bool operator== (const K &lhs, const DataItem< K, D > &rhs)
std::ostream & operator<< (std::ostream &os, const Data &data)
bool ReadRegistry (const std::string &filepath, Registry &reg, bool quiet=true)
const std::pair< std::string,
bool > 
GetString (const std::string &prefix, const std::string &key, const Registry &reg)
bool Read (const Registry &reg, const std::string &key, bool &value)
bool Read (const Registry &reg, const std::string &key, std::string &value)
int SetKey (Registry &reg, const std::string &key, const std::string &value)
TDirectory * GetDir (std::string path, TDirectory *dir)
TH1 * SetDir (TH1 *h, TDirectory *dir, const std::string &name="")
MutexGetMainMutex ()
MutexGetROOTMutex ()
float uv2x (float u, float v)
float uv2y (float u, float v)
float xy2u (float x, float y)
float xy2v (float x, float y)
double pi ()
double angle (double x, double y)
const CoordXYZ gnumi_to_near (const CoordXYZ pos)
const CoordXYZ near_to_gnumi (const CoordXYZ pos)
const CoordXYZ gnumi_to_far (const CoordXYZ pos)
const CoordXYZ far_to_gnumi (const CoordXYZ pos)
template<typename T >
std::vector< T > ReadList (const Registry &reg, const std::string &key, const std::string &sep)
template<typename T >
void PrintList (const std::string &name, const std::vector< T > &lvec)
bool operator== (short index, const Event &event)
bool operator== (const Event &event, short index)
bool operator== (const Event &lhs, const Event &rhs)
bool operator== (const Event &event, const Shower &shower)
bool operator== (const Shower &shower, const Event &event)
bool operator== (const Track &track, const Event &event)
bool operator== (const Event &event, const Track &track)
bool operator< (const DataNPlane &lhs, const DataNPlane &rhs)
bool operator== (const DataNPlane &lhs, const DataNPlane &rhs)
bool operator== (const CountPlaneStrip &lhs, const CountPlaneStrip &rhs)
template<typename T >
std::ostream & operator<< (std::ostream &o, const Handle< T > &handle)
bool operator== (const Header &lhs, const Header &rhs)
bool operator!= (const Header &lhs, const Header &rhs)
std::ostream & operator<< (std::ostream &o, const Header &self)
TH1 * MakeTH1 (const std::string &dir, TDirectory *dir_, const std::string &key)
TH2 * MakeTH2 (const std::string &dir, TDirectory *dir_, const std::string &key)
std::ostream & operator<< (std::ostream &o, const HistInfo &self)
std::ostream & operator<< (std::ostream &o, const AxisInfo &self)
template<typename T >
bool operator< (const Bin< T > &lhs, const Bin< T > &rhs)
template<typename T >
bool operator< (const Bin< T > &lhs, const T &rhs)
template<typename T >
bool operator< (const T &lhs, const Bin< T > &rhs)
template<typename T >
bool operator< (const Bin< T > &lhs, unsigned int bin)
template<typename T >
bool operator< (unsigned int bin, const Bin< T > &rhs)
template<typename T >
bool operator== (const Bin< T > &lhs, unsigned int bin)
template<typename T >
bool operator== (unsigned int bin, const Bin< T > &rhs)
template<typename T >
Bin< T > Merge (const Bin< T > &lhs, const Bin< T > &rhs)
template<typename T >
TH1 * CreateTH1 (const Hist1d< T > &h, const std::string &name="h")
template<typename T >
std::ostream & operator<< (std::ostream &o, const Bin< T > &self)
template<typename T >
GetKernelOverlap (const T lpos, const T rpos, const T cpos, const T width)
template<typename T >
std::ostream & operator<< (std::ostream &o, const Hist1d< T > &self)
template<typename T >
std::ostream & operator<< (std::ostream &o, const KeyPair< T > &self)
void * run_alg_thread (void *data_)
bool operator== (const FitPoint &lhs, const FitPoint &rhs)
bool operator< (const FitPoint &lhs, const FitPoint &rhs)
bool operator< (double value, const FitPoint &fit)
bool operator< (const FitPoint &rhs, double value)
bool operator== (int index, const FitPoint &fit)
bool operator== (const FitPoint &fit, int index)
bool operator== (short index, const MRCCInfo &mrccin)
bool operator== (const MRCCInfo &mrccin, short index)
bool operator== (const MRCCInfo &lhs, const MRCCInfo &rhs)
bool operator== (const Anp::Handle< Anp::CountHist > &lhs, const Anp::Handle< Anp::CountHist > &rhs)
bool operator< (const PlaneHitColl &lhs, const PlaneHitColl &rhs)
bool operator== (const PlaneHitColl &lhs, const PlaneHitColl &rhs)
bool operator< (const short lhs, const PlaneHitColl &rhs)
bool operator< (const PlaneHitColl &lhs, const short rhs)
bool operator== (const short lhs, const PlaneHitColl &rhs)
bool operator== (const PlaneHitColl &lhs, const short rhs)
bool operator== (short index, const RecoNu &rnu)
bool operator== (const RecoNu &rnu, short index)
bool operator== (const RecoNu &lhs, const RecoNu &rhs)
double RecoQ2 (const RecoNu &rnu, Reco::Formula formula)
double RecoW2 (const RecoNu &rnu, Reco::Formula formula)
double m_proton ()
double m_muon ()
double m_delta ()
double m_proton2 ()
double m_muon2 ()
double m_delta2 ()
void * get_snarl_done (void *alg_)
void PrintStopWatch (double realt, double cput)
template<class T >
void * get_thread_done (void *data_)
double GetUVAssymForQES (const Event &event, const Record &record)
const std::vector< RunSubrunReadRunList (const std::string &path, bool print=false)
bool operator== (const RunSubrun &lhs, const RunSubrun &rhs)
bool operator< (const StripLink A, const StripLink B)
bool operator== (short index, const Shower &shower)
bool operator== (const Shower &shower, short index)
bool operator== (const Shower &lhs, const Shower &rhs)
NtpSRStripGetSRStrip (const NtpStRecord &ntpr, int index)
void PrintStrips (const NtpStRecord &record, const int *index_array, int nstrip)
template<class T >
std::vector< const T * > FillRecoTruth (const TClonesArray *array)
bool operator== (short index, const Strip &strip)
bool operator== (const Strip &strip, short index)
bool operator== (const Strip &lhs, const Strip &rhs)
bool operator== (short index, const Track &track)
bool operator== (const Track &track, short index)
bool operator== (const Track &lhs, const Track &rhs)
bool operator== (short index, const TrueNu &reco)
bool operator== (const TrueNu &reco, short index)
bool operator== (const TrueNu &lhs, const TrueNu &rhs)
bool operator== (const TrueNu &tnu, const RecoNu &rnu)
bool operator== (const RecoNu &rnu, const TrueNu &tnu)
bool operator== (short index, const Truth &truth)
bool operator== (const Truth &truth, short index)
bool operator== (const Truth &lhs, const Truth &rhs)
bool operator== (const Event &event, const Truth &truth)
bool operator== (const Truth &truth, const Event &event)
bool operator== (const RecoNu &reco, const Truth &truth)
bool operator== (const Truth &truth, const RecoNu &reco)
bool operator== (const Track &track, const Truth &truth)
bool operator== (const Truth &truth, const Track &track)
bool operator== (const Shower &shower, const Truth &truth)
bool operator== (const Truth &truth, const Shower &shower)
bool operator== (const Event &event, const TruthReco &truth)
bool operator== (const TruthReco &truth, const Event &event)
bool operator== (const Track &track, const TruthReco &truth)
bool operator== (const TruthReco &truth, const Track &track)
bool operator== (const RecoNu &event, const TruthReco &truth)
bool operator== (const TruthReco &truth, const RecoNu &event)
bool operator== (const Shower &shower, const TruthReco &truth)
bool operator== (const TruthReco &truth, const Shower &shower)
TrackIter LongestTrack (const Event &event, const Record &record)
ShowerIter FirstShower (const Event &event, const Record &record)
ShowerIter PrimaryShower (const Event &event, const Record &record)
TrackVec GetTrack (const Event &event, const Record &record)
ShowerVec GetShower (const Event &event, const Record &record)
StripVec GetStrip (const Event &event, const Record &record, const char *view=0)
StripVec GetStrip (const Track &track, const Record &record, const char *view=0)
StripVec GetStrip (const Shower &shower, const Record &record, const char *view=0)
void CleanRecord (const EventIter ibeg, const EventIter iend, Record &record)
void ApplyTrueWeights (Record &record)
void PrintRecordTruth (const Record &record, std::ostream &o=std::cout)

Variables

static Mutex ROOTMutex
static Mutex MAINMutex
static const double GNUMINearX = 1.48844
static const double GNUMINearY = 0.0
static const double GNUMINearZ = 1036.49
static const double GNUMIFarX = 0.0
static const double GNUMIFarY = 0.0
static const double GNUMIFarZ = 735.34E3
static const double GNUMICosZ = 0.998318471
static const double GNUMISinZ = 0.057967487

Detailed Description

Handle class template - a simplified version of boost::intrusive_ptr.

!!do not remove cassert!!!

Abstract Factory template that handles arbitrary types

This template creates Factory stores creator functors to template parameter class. Factory is a singelton class which is explicitly deleted.

Source: Andrei Alexandrescu, Modern C++ Design

_____________________________________________________________________________

It's a smart pointer for objects with "built-in" reference count. Such implemetation makes the smallest possible smart pointer - its size is equivalent to just a single raw pointer.

_____________________________________________________________________________


Typedef Documentation

Definition at line 66 of file AlgEvent.h.

Definition at line 72 of file AlgSnarl.h.

Definition at line 62 of file AlgStore.h.

typedef DataItem<Short_t, Float_t> Anp::Data

Definition at line 63 of file DataItem.h.

typedef DataVec::const_iterator Anp::DataIter

Definition at line 65 of file DataItem.h.

typedef DataVec::iterator Anp::DataIterator

Definition at line 66 of file DataItem.h.

typedef std::vector<Anp::Data> Anp::DataVec

Definition at line 64 of file DataItem.h.

typedef std::vector<Anp::Event>::const_iterator Anp::EventIter

Definition at line 23 of file PhysicsNtuple/HEAD/Utils.h.

typedef std::vector<Anp::Event>::iterator Anp::EventIterator

Definition at line 33 of file PhysicsNtuple/HEAD/Utils.h.

Definition at line 54 of file EventTab.h.

typedef std::vector<Anp::MRCCInfo>::const_iterator Anp::MRCCIter

Definition at line 31 of file PhysicsNtuple/HEAD/Utils.h.

typedef std::vector<Anp::MRCCInfo>::iterator Anp::MRCCIterator

Definition at line 39 of file PhysicsNtuple/HEAD/Utils.h.

typedef std::vector<MRCCIter> Anp::MRCCVec

Definition at line 44 of file PhysicsNtuple/HEAD/Utils.h.

typedef std::vector<Anp::Shower>::const_iterator Anp::ShowerIter

Definition at line 29 of file PhysicsNtuple/HEAD/Utils.h.

typedef std::vector<Anp::Shower>::iterator Anp::ShowerIterator

Definition at line 37 of file PhysicsNtuple/HEAD/Utils.h.

typedef std::vector<ShowerIter> Anp::ShowerVec

Definition at line 43 of file PhysicsNtuple/HEAD/Utils.h.

typedef std::vector<Anp::StdHep>::const_iterator Anp::StdHepIter

Definition at line 30 of file PhysicsNtuple/HEAD/Utils.h.

typedef std::vector<Anp::StdHep>::iterator Anp::StdHepIterator

Definition at line 38 of file PhysicsNtuple/HEAD/Utils.h.

typedef DataItem<std::string, Float_t> Anp::StringData

Definition at line 62 of file DataItem.h.

typedef std::vector<Anp::Strip>::const_iterator Anp::StripIter

Definition at line 28 of file PhysicsNtuple/HEAD/Utils.h.

typedef std::vector<Anp::Strip>::iterator Anp::StripIterator

Definition at line 36 of file PhysicsNtuple/HEAD/Utils.h.

typedef std::vector<StripIter> Anp::StripVec

Definition at line 41 of file PhysicsNtuple/HEAD/Utils.h.

typedef std::vector<Anp::Track>::const_iterator Anp::TrackIter

Definition at line 26 of file PhysicsNtuple/HEAD/Utils.h.

typedef std::vector<Anp::Track>::iterator Anp::TrackIterator

Definition at line 34 of file PhysicsNtuple/HEAD/Utils.h.

typedef std::vector<TrackIter> Anp::TrackVec

Definition at line 42 of file PhysicsNtuple/HEAD/Utils.h.

typedef std::vector<Anp::Truth>::const_iterator Anp::TruthIter

Definition at line 27 of file PhysicsNtuple/HEAD/Utils.h.

typedef std::vector<Anp::Truth>::iterator Anp::TruthIterator

Definition at line 35 of file PhysicsNtuple/HEAD/Utils.h.

typedef std::vector<Anp::TruthReco>::const_iterator Anp::TruthRecoIter

Definition at line 25 of file Truth.h.

typedef std::vector<Anp::TruthReco>::iterator Anp::TruthRecoIterator

Definition at line 26 of file Truth.h.


Function Documentation

double Anp::angle ( double  x,
double  y 
)

Definition at line 95 of file Default.cxx.

References pi().

Referenced by AtNuFluxRW::ApplyRatio(), MinosOutline::BuildFarActive(), Anp::FillTrackGeom::Fill(), Anp::PlotTrackGeom::FillProjection(), Anp::PlotTrackGeom::FillRotation(), Anp::PlotTrackGeom::FillXProduct(), TruthCompareAna::MatchRecoElectron(), TruthCompareAna::MatchRecoMuon(), TruthCompareAna::MatchRecoProton(), nutation_angles(), Anp::PlotEvent::Plot(), TridSketchEllipse::TridSketchEllipse(), and TridSketchTube::TridSketchTube().

00096 {
00097    const double radius = std::sqrt(x*x + y*y);
00098    
00099    if(!(radius > 0.0))
00100    {
00101       return 0.0;
00102    }
00103    
00104    if(!(+x < radius))
00105    {
00106       return std::acos(+1.0);
00107    }
00108    if(!(-x < radius))
00109    {
00110       return std::acos(-1.0);
00111    }
00112 
00113    double angle = std::acos(x/radius);
00114    
00115    if(y < 0.0)
00116    {
00117       angle = 2.0 * pi() - angle;
00118    }
00119 
00120    return angle;
00121 }

void Anp::ApplyTrueWeights ( Record &  record  ) 

Definition at line 317 of file Utils.cxx.

References Anp::Record::EventBegIterator(), Anp::Record::EventEndIterator(), Anp::Record::FindTruth(), Anp::Record::GetHeader(), Anp::Header::IsData(), Anp::Record::ShowerBegIterator(), Anp::Record::ShowerEndIterator(), Anp::Record::TrackBegIterator(), Anp::Record::TrackEndIterator(), Anp::Record::TruthBeg(), and Anp::Record::TruthEnd().

Referenced by Anp::FillFlux::Run(), and Anp::SelectFlux::Run().

00318 {
00319    //
00320    // Apply weights to reconstructed objects
00321    //
00322 
00323    if(record.GetHeader().IsData() || record.TruthBeg() == record.TruthEnd())
00324    {
00325       return;
00326    }
00327 
00328    for(EventIterator ievent = record.EventBegIterator(); ievent != record.EventEndIterator(); ++ievent)
00329    {      
00330       const TruthIter itruth = record.FindTruth(*ievent);
00331 
00332       if(itruth != record.TruthEnd())
00333       {
00334          ievent -> SetWeight(itruth -> Weight());
00335       }
00336       else
00337       {
00338          cerr << "ApplyTrueWeights - failed to find truth record" << endl;
00339       }
00340    }
00341 
00342    for(TrackIterator itrack = record.TrackBegIterator(); itrack != record.TrackEndIterator(); ++itrack)
00343    {      
00344       const TruthIter itruth = record.FindTruth(*itrack);
00345 
00346       if(itruth != record.TruthEnd())
00347       {
00348          itrack -> SetWeight(itruth -> Weight());
00349       }
00350       else
00351       {
00352          cerr << "ApplyTrueWeights - failed to find truth record" << endl;
00353       }
00354    }
00355 
00356    for(ShowerIterator ishower = record.ShowerBegIterator(); ishower != record.ShowerEndIterator(); ++ishower)
00357    {      
00358       const TruthIter itruth = record.FindTruth(*ishower);
00359 
00360       if(itruth != record.TruthEnd())
00361       {
00362          ishower -> SetWeight(itruth -> Weight());
00363       }
00364       else
00365       {
00366          cerr << "ApplyTrueWeights - failed to find truth record" << endl;
00367       }
00368    }
00369 }

void Anp::CleanRecord ( const EventIter  ibeg,
const EventIter  iend,
Record &  record 
)

Definition at line 271 of file Utils.cxx.

References Anp::Record::Erase(), find(), Anp::Record::ShowerBegIterator(), Anp::Record::ShowerEndIterator(), Anp::Record::TrackBegIterator(), and Anp::Record::TrackEndIterator().

Referenced by Anp::SelectNuMu::Run(), Anp::FillShortEvent::Run(), Anp::SelectKinem::Run(), Anp::SelectNC::Run(), Anp::SelectShort::Run(), and Anp::SelectTrue::Run().

00272 {
00273    //
00274    // Remove reconstructed tracks that do not match events in (ibeg, iend) range
00275    //
00276    TrackIterator itrack = record.TrackBegIterator();
00277    while(itrack != record.TrackEndIterator())
00278    {      
00279       //
00280       // Find first event that matches this track
00281       //
00282       const EventIter ievent = std::find(ibeg, iend, *itrack);
00283 
00284       if(ievent != iend)
00285       {
00286          ++itrack;
00287       }
00288       else
00289       {
00290          itrack = record.Erase(itrack);
00291       }
00292    }
00293 
00294    //
00295    // Remove reconstructed showers that do not match events in (ibeg, iend) range
00296    //
00297    ShowerIterator ishower = record.ShowerBegIterator();
00298    while(ishower != record.ShowerEndIterator())
00299    {
00300       //
00301       // Find first event that matches this shower
00302       //
00303       const EventIter ievent = std::find(ibeg, iend, *ishower);
00304       
00305       if(ievent != iend)
00306       {
00307          ++ishower;
00308       }
00309       else
00310       {
00311          ishower = record.Erase(ishower);
00312       }
00313    }
00314 }

const std::vector<double> Anp::ConvertString2Vector ( const std::string &  dstr  ) 
template<class T >
const std::vector<T> Anp::ConvertStringToVector ( const std::string &  dstr  )  [inline]

Definition at line 130 of file AlgAdapt.h.

References UtilString::StringTok().

00131   {
00132      std::vector<T> dvec;
00133 
00134      //
00135      // Parse into individual strings
00136      //
00137      std::vector<std::string> svec;
00138      UtilString::StringTok(svec, dstr, ", ");
00139      
00140      if(svec.empty())
00141      {
00142         return dvec;
00143      }
00144 
00145      for(unsigned int i = 0; i < svec.size(); ++i)
00146      {
00147         std::stringstream temp;
00148         temp << svec[i];
00149         
00150         T value;
00151         temp >> value;
00152         
00153         if(!temp.fail())
00154         {
00155            dvec.push_back(value);
00156         }
00157         else
00158         {
00159            std::cerr << "Anp::ConvertString2Vector - stringstream >> failed for " << svec[i] << std::endl;
00160         }
00161      }
00162      
00163      return dvec;
00164   }

const std::string Anp::ConvertVector2String ( const std::vector< double > &  dvec  ) 
template<class T >
const std::string Anp::ConvertVectorToString ( const std::vector< T > &  dvec  )  [inline]

Definition at line 117 of file AlgAdapt.h.

00118    {
00119       std::stringstream dstr;
00120       for(typename std::vector<T>::const_iterator dit = dvec.begin(); dit != dvec.end(); ++dit)
00121       {
00122          dstr << *dit;
00123          if(dit + 1 != dvec.end()) dstr << ", ";
00124       }
00125       
00126       return dstr.str();
00127    }

template<typename T >
TH1 * Anp::CreateTH1 ( const Hist1d< T > &  h,
const std::string &  name = "h" 
) [inline]

Definition at line 987 of file Hist1d.h.

References Anp::Hist1d< T >::GetBins(), Anp::Hist1d< T >::GetIntegral(), and SetDir().

00988    {
00989       const std::vector<Bin<T> > &bvec = h.GetBins();
00990 
00991       if(bvec.empty())
00992       {
00993          return 0;
00994       }
00995 
00996       double *array = new double[bvec.size() - 1];
00997 
00998       for(int ibin = 1; ibin < int(bvec.size()); ++ibin)
00999       {
01000          array[ibin - 1] = bvec[ibin].edge();
01001       }
01002 
01003       TH1 *th1 = new TH1D(name.c_str(), name.c_str(), bvec.size() - 2, array);
01004 
01005       delete [] array;
01006 
01007       for(int ibin = 0; ibin < int(bvec.size()); ++ibin)
01008       {
01009          th1 -> SetBinContent(ibin, bvec[ibin].sum());
01010       }
01011 
01012       Anp::SetDir(th1, 0);
01013       th1 -> SetEntries(h.GetIntegral("UO"));
01014 
01015       return th1;
01016    }

const Anp::CoordXYZ Anp::far_to_gnumi ( const CoordXYZ  pos  ) 

Definition at line 84 of file Default.cxx.

References GNUMICosZ, GNUMIFarZ, GNUMISinZ, Anp::CoordXYZ::y, and Anp::CoordXYZ::z.

00085 {
00086    CoordXYZ new_pos = pos;
00087    
00088    new_pos.z =  pos.z * GNUMICosZ + pos.y * GNUMISinZ + GNUMIFarZ;
00089    new_pos.y = -pos.z * GNUMISinZ + pos.y * GNUMICosZ;
00090 
00091    return new_pos;
00092 }

template<class T >
vector< const T * > Anp::FillRecoTruth ( const TClonesArray *  array  )  [inline]

Definition at line 613 of file FillTruth.cxx.

References nentries.

00614 {
00615    //
00616    // Collect and return records that match true and reconstructed objects
00617    //
00618 
00619    vector<const T *> tvec;
00620 
00621    if(!array)
00622    {
00623       cerr << "FillRecoTruth<T> - TClonesArray of reco-to-truth records does not exist" << endl;
00624       return tvec;
00625    }
00626 
00627    const int nentries = array -> GetEntries();
00628    for(int index = 0; index < nentries; ++index)
00629    {
00630       const T *treco = dynamic_cast<const T *>(array -> At(index));
00631       if(!treco)
00632       {
00633          cerr << "FillRecoTruth<T> - dynamic_cast failed at index: "<< index << endl;
00634          continue;
00635       }      
00636 
00637       if(treco -> index != index)
00638       {
00639          cerr << "FillRecoTruth<T> - wrong index at index: "<< index << endl;
00640          continue;
00641       } 
00642       
00643       tvec.push_back(treco);
00644    }
00645    
00646    return tvec;
00647 }

Anp::ShowerIter Anp::FirstShower ( const Event event,
const Record &  record 
)

Definition at line 46 of file Utils.cxx.

References Anp::Event::FirstShower(), Anp::Record::ShowerBeg(), and Anp::Record::ShowerEnd().

Referenced by PrimaryShower(), Anp::PlotShower::Run(), and Anp::PlotBasic::Run().

00047 {  
00048    //
00049    // Return first event shower
00050    //
00051 
00052    for(ShowerIter ishower = record.ShowerBeg(); ishower != record.ShowerEnd(); ++ishower)
00053    {
00054       if(event.FirstShower(ishower -> ShowerIndex()))
00055       {
00056          return ishower;
00057       }
00058    }
00059 
00060    return record.ShowerEnd();
00061 }

void * Anp::get_snarl_done ( void *  alg_  ) 

Definition at line 380 of file RunAlgSnarl.cxx.

Referenced by Anp::RunAlgSnarl::Init().

00381 {
00382    //
00383    // Global function that runs in a new thread
00384    //
00385    if(!alg_)
00386    {
00387       cerr << "Anp::get_snarl_done - null input pointer" << endl;
00388       return 0;
00389    }
00390 
00391    //
00392    // Get algorithm pointer
00393    //
00394    Anp::RunAlgSnarl *alg = static_cast<Anp::RunAlgSnarl *> (alg_);
00395    
00396    while(true)
00397    {
00398       Anp::Lock<Anp::Mutex> lock(alg -> fMutex);
00399       
00400       //
00401       // All work is done, exit function
00402       //
00403       if(alg -> fCond.GetValue() != 0 &&
00404          alg -> fCond.GetValue() != 1)
00405       {
00406          break;
00407       }
00408       
00409       while(alg -> fCond.GetValue() == 0)
00410       {
00411          alg -> fCond.Wait(alg -> fMutex);
00412       }
00413       
00414       //
00415       // Do actual work and reset status to idle
00416       //
00417       if(alg -> fCond.GetValue() == 1)
00418       {
00419          alg -> RunRecord();
00420          alg -> fCond.SetValue(0);
00421          alg -> fCond.Signal();
00422       }
00423    }
00424 
00425    return alg;
00426 }

template<class T >
void* Anp::get_thread_done ( void *  data_  )  [inline]

Definition at line 66 of file RunThread.h.

00067    {
00068       if(!data_)
00069       {
00070          std::cerr << "Anp::get_thread_done - null data pointer" << std::endl;
00071          return 0;
00072       }
00073       
00074       T *data = static_cast<T *> (data_);
00075       
00076       data -> GetDone();
00077       
00078       return data;
00079    }

TDirectory * Anp::GetDir ( std::string  path,
TDirectory *  dir 
)

Definition at line 377 of file Default.cxx.

References GetROOTMutex().

Referenced by Anp::FillData::Config(), Anp::PlotTruth::GetPlot(), Anp::PlotFlux::GetPlot(), Anp::PlotReson::GetPlot(), Anp::PlotShortSelect::Plot(), Anp::PlotShort::Plot(), Anp::PlotShort::PlotStandard(), Anp::Plot::Data::Set(), Anp::PlotKinem::Set(), Anp::PlotTrack::Set(), Anp::SelectTrue::Set(), Anp::SelectNC::Set(), Anp::PlotData::Set(), Anp::PlotEvent::Set(), Anp::PlotTime::Set(), Anp::PlotTrackGeom::Set(), Anp::RunAlgSnarl::Set(), Anp::SelectCount::Set(), Anp::SelectKinem::Set(), Anp::PlotPur::Set(), Anp::SelectNuMu::Set(), Anp::FillData::Set(), Anp::PlotPmt::Set(), Anp::RunAlgEvent::Set(), Anp::PlotBasic::Set(), Anp::PlotTruth::Set(), Anp::PlotFlux::Set(), Anp::PlotSnarl::Set(), Anp::PlotShower::Set(), Anp::PlotVtx::Set(), Anp::PlotEff::Set(), Anp::PlotShort::Set(), and Anp::PlotShortSelect::Set().

00378 {
00379    //
00380    // Recursively reate directory path in dir
00381    //
00382    if(!dir || path.empty() || path == "/")
00383    {
00384       return dir;
00385    }
00386    
00387    // remove trailing slash if present
00388    if(path.substr(path.size() - 1, 1) == "/")
00389    {
00390       path = path.substr(0, path.size() - 1);
00391    }
00392 
00393    std::string::size_type pos = path.find_last_of('/');
00394    if(pos != std::string::npos)
00395    {
00396       // recursively walk upward until all slash characters are removed
00397       dir = Anp::GetDir(path.substr(0, pos), dir);
00398 
00399       // make directory path of last substring without slash
00400       path = path.substr(pos + 1, path.size() - pos);
00401    }
00402 
00403    Anp::Lock<Mutex> lock(Anp::GetROOTMutex());
00404 
00405    if(dir -> Get(path.c_str()))
00406    {
00407       return dynamic_cast<TDirectory *>(dir -> Get(path.c_str()));
00408    }
00409    
00410    return dir -> mkdir(path.c_str());
00411 }

template<typename T >
T Anp::GetKernelOverlap ( const T  lpos,
const T  rpos,
const T  cpos,
const T  width 
) [inline]

Definition at line 297 of file Hist1d.h.

00298    {
00299       // Compute fraction of kernel intergral for kernel centered at x0 = cpos 
00300       // and between lpos and rpos boundaries. Kernel function is (1-((x-x0)/w)^2)^2
00301       // for x < 1.0 and 0 otherwise. Kerner integral I(x) = (x - 2*x^3/3 + x^5/5)/C,
00302       // where C = 16/15.
00303       
00304       if(!(lpos < rpos) || !(width > 0.0))
00305       {
00306          std::cerr << "GetKernelOverlap - invalid input parameters (" 
00307                    << lpos << ", " << rpos << ", " << cpos << ", " << width << ")" << std::endl;
00308          return 0;
00309       }
00310 
00311       T ledge = cpos - width;
00312       T redge = cpos + width;
00313 
00314       if(ledge < lpos) ledge = lpos;
00315       if(redge > rpos) redge = rpos;
00316       
00317       const T x1 = (ledge - cpos)/width;
00318       const T x2 = (redge - cpos)/width;
00319 
00320       const T I1 = x1 - 2.0*x1*x1*x1/3.0 + x1*x1*x1*x1*x1/5.0;
00321       const T I2 = x2 - 2.0*x2*x2*x2/3.0 + x2*x2*x2*x2*x2/5.0;
00322 
00323       const T overlap = 15.0*(I2 - I1)/16.0;
00324 
00325       //std::cout << "(lpos, rpos, cpos) = (" 
00326       //<< lpos << ", " << rpos << ", " << cpos << ")" << std::endl
00327       //<< "(ledg, redg, width, overlap) = (" 
00328       //<< ledge << ", " << redge << ", " << width << ", " << overlap << ")" << std::endl;
00329 
00330       return overlap;
00331    }

Anp::Mutex & Anp::GetMainMutex (  ) 

Definition at line 432 of file Default.cxx.

References MAINMutex.

Referenced by Anp::RunAlgSnarl::Config(), Anp::PlotFlux::GetPlot(), Anp::FillFlux::Init(), and Anp::FillFlux::Run().

00433 {
00434    return MAINMutex;
00435 }

Anp::Mutex & Anp::GetROOTMutex (  ) 
Anp::ShowerVec Anp::GetShower ( const Event event,
const Record &  record 
)

Definition at line 118 of file Utils.cxx.

References Anp::Event::MatchShower(), Anp::Record::ShowerBeg(), and Anp::Record::ShowerEnd().

Referenced by Anp::FillEvent::Run(), and Anp::EventHitTab::SetShowers().

00119 {
00120    //
00121    // Find all showers that belongs this reconstructed event
00122    //
00123 
00124    ShowerVec vec;
00125    for(ShowerIter shower = record.ShowerBeg(); shower != record.ShowerEnd(); ++shower)
00126    {
00127       if(event.MatchShower(shower -> ShowerIndex()))
00128       {
00129          vec.push_back(shower);
00130       }
00131    }
00132 
00133    return vec;
00134 }

NtpSRStrip * Anp::GetSRStrip ( const NtpStRecord ntpr,
int  index 
)

Definition at line 587 of file FillBasic.cxx.

References Msg::kWarning, MSG, and NtpStRecord::stp.

Referenced by Anp::FillBasic::Get(), and PrintStrips().

00588 {
00589    //
00590    // Return pointer to NtpSRStrip with "index"
00591    //
00592    const TClonesArray *strip_array = record.stp;
00593    if(!strip_array)
00594    {
00595       MSG("FillAlg", Msg::kWarning) << "NtpStRecord does not have valid strip array." << endl; 
00596       return 0;
00597    }
00598 
00599    NtpSRStrip *ntpstp  = dynamic_cast<NtpSRStrip *>(strip_array -> At(index));
00600    if(!ntpstp)
00601    {
00602       MSG("FillAlg", Msg::kWarning) << "Could not find NtpSRStrip at " << index << endl;
00603       return 0;
00604    }      
00605    
00606    return ntpstp;
00607 }

const std::pair< std::string, bool > Anp::GetString ( const std::string &  prefix,
const std::string &  key,
const Registry reg 
)

Definition at line 238 of file Default.cxx.

References Registry::Get().

Referenced by Anp::SelectCount::Config(), NuAnalysis::ExtractConfig(), TGeant3::MediumId(), and PTGuiMainFrame::ProcessMessage().

00241 {
00242    std::pair<std::string, bool> result(std::string(""), false);
00243    
00244    if(prefix.empty() && key.empty())
00245    {
00246       return result;
00247    }
00248 
00249    const char *value_char = 0;
00250    if(reg.Get((prefix + key).c_str(), value_char)  && value_char)
00251    {
00252       result.first = value_char;
00253       result.second = true;      
00254    }
00255    else if(reg.Get(key.c_str(), value_char)  && value_char)
00256    {
00257       result.first = value_char;
00258       result.second = true;     
00259    }
00260 
00261    return result;
00262 }

Anp::StripVec Anp::GetStrip ( const Shower &  shower,
const Record &  record,
const char *  view = 0 
)

Definition at line 226 of file Utils.cxx.

References Anp::Shower::ShowerIndex(), Anp::Record::StripBeg(), and Anp::Record::StripEnd().

00227 {
00228    //
00229    // Find all strips that belongs this reconstructed shower
00230    //
00231 
00232    short key = 0;
00233    if(view)
00234    {
00235       if(std::strcmp(view, "V") == 0 || std::strcmp(view, "v") == 0)
00236       {
00237          key = 3;
00238       }
00239       else if(std::strcmp(view, "U") == 0 || view && std::strcmp(view, "u") == 0)
00240       {
00241          key = 2;
00242       }
00243    }
00244 
00245    StripVec vec;
00246    for(StripIter strip = record.StripBeg(); strip != record.StripEnd(); ++strip)
00247    {
00248       if(!strip -> MatchShw(shower.ShowerIndex()))
00249       {
00250          continue;
00251       }
00252 
00253       if(key == 0)
00254       {
00255          vec.push_back(strip);
00256       }
00257       else if(key == 3 && strip -> IsVview())
00258       {
00259          vec.push_back(strip);
00260       }
00261       else if(key == 2 && strip -> IsUview())
00262       {
00263          vec.push_back(strip);
00264       }
00265    }
00266 
00267    return vec;
00268 }

Anp::StripVec Anp::GetStrip ( const Track &  track,
const Record &  record,
const char *  view = 0 
)

Definition at line 182 of file Utils.cxx.

References Anp::Record::StripBeg(), Anp::Record::StripEnd(), and Anp::Track::TrackIndex().

00183 {
00184    //
00185    // Find all strips that belongs this reconstructed track
00186    //
00187 
00188    short key = 0;
00189    if(view)
00190    {
00191       if(std::strcmp(view, "V") == 0 || std::strcmp(view, "v") == 0)
00192       {
00193          key = 3;
00194       }
00195       else if(std::strcmp(view, "U") == 0 || view && std::strcmp(view, "u") == 0)
00196       {
00197          key = 2;
00198       }
00199    }
00200 
00201    StripVec vec;
00202    for(StripIter strip = record.StripBeg(); strip != record.StripEnd(); ++strip)
00203    {
00204       if(!strip -> MatchTrk(track.TrackIndex()))
00205       {
00206          continue;
00207       }
00208 
00209       if(key == 0)
00210       {
00211          vec.push_back(strip);
00212       }
00213       else if(key == 3 && strip -> IsVview())
00214       {
00215          vec.push_back(strip);
00216       }
00217       else if(key == 2 && strip -> IsUview())
00218       {
00219          vec.push_back(strip);
00220       }
00221    }   
00222    return vec;
00223 }

Anp::StripVec Anp::GetStrip ( const Event event,
const Record &  record,
const char *  view = 0 
)

Definition at line 137 of file Utils.cxx.

References Anp::Event::EventIndex(), Anp::Record::StripBeg(), and Anp::Record::StripEnd().

Referenced by Anp::PlotPmt::Collect(), Anp::FillShortVar::Get(), Anp::RunModule::Run(), Anp::FillSnarl::Run(), Anp::StdHepTab::Set(), Anp::EventAdcTab::Set(), Anp::SnarlAdcTab::Set(), Anp::EventHitTab::SetShowers(), and Anp::EventHitTab::SetTrack().

00138 {
00139    //
00140    // Find all strips that belongs this reconstructed event
00141    //
00142 
00143    short key = 0;
00144    if(view)
00145    {
00146       if(std::strcmp(view, "V") == 0 || std::strcmp(view, "v") == 0)
00147       {
00148          key = 3;
00149       }
00150       else if(std::strcmp(view, "U") == 0 || view && std::strcmp(view, "u") == 0)
00151       {
00152          key = 2;
00153       }
00154    }
00155 
00156    StripVec vec;
00157    for(StripIter strip = record.StripBeg(); strip != record.StripEnd(); ++strip)
00158    {
00159       if(!strip -> MatchEvt(event.EventIndex()))
00160       {
00161          continue;
00162       }
00163 
00164       if(key == 0)
00165       {
00166          vec.push_back(strip);
00167       }
00168       else if(key == 3 && strip -> IsVview())
00169       {
00170          vec.push_back(strip);
00171       }
00172       else if(key == 2 && strip -> IsUview())
00173       {
00174          vec.push_back(strip);
00175       }
00176    }
00177 
00178    return vec;
00179 }

Anp::TrackVec Anp::GetTrack ( const Event event,
const Record &  record 
)

Definition at line 100 of file Utils.cxx.

References Anp::Event::MatchTrack(), Anp::Record::TrackBeg(), and Anp::Record::TrackEnd().

Referenced by Anp::FillShortVar::Run(), Anp::FillEvent::Run(), Anp::SelectShort::Run(), Anp::SelectReson::Run(), and Anp::EventHitTab::Set().

00101 {
00102    //
00103    // Find all tracks that belongs this reconstructed event
00104    //
00105 
00106    TrackVec vec;
00107    for(TrackIter track = record.TrackBeg(); track != record.TrackEnd(); ++track)
00108    {
00109       if(event.MatchTrack(track -> TrackIndex()))
00110       {
00111          vec.push_back(track);
00112       }
00113    }   
00114    return vec;
00115 }

double Anp::GetUVAssymForQES ( const Event event,
const Record &  record 
)

Definition at line 506 of file SelectKinem.cxx.

References PrimaryShower(), and Anp::Record::ShowerEnd().

Referenced by Anp::SelectKinem::Pass().

00507 {
00508    //
00509    // Get UV assymmetry of primary event shower
00510    //
00511 
00512    const ShowerIter ishower = Anp::PrimaryShower(event, record);
00513    if(ishower == record.ShowerEnd())
00514    {
00515       return 0.0;
00516    }
00517    
00518    const double uv_sum = (ishower -> GetBasic()).SigCorU() + (ishower -> GetBasic()).SigCorV();
00519    const double uv_dif = (ishower -> GetBasic()).SigCorU() - (ishower -> GetBasic()).SigCorV();
00520    
00521    if(uv_sum > 0.0)
00522    {
00523       return uv_dif/uv_sum;
00524    }
00525 
00526    return 0.0;
00527 }

const Anp::CoordXYZ Anp::gnumi_to_far ( const CoordXYZ  pos  ) 

Definition at line 73 of file Default.cxx.

References GNUMICosZ, GNUMIFarZ, GNUMISinZ, Anp::CoordXYZ::y, and Anp::CoordXYZ::z.

00074 {
00075    CoordXYZ new_pos = pos;
00076    
00077    new_pos.z = (pos.z - GNUMIFarZ) * GNUMICosZ - pos.y * GNUMISinZ;
00078    new_pos.y = (pos.z - GNUMIFarZ) * GNUMISinZ + pos.y * GNUMICosZ;
00079 
00080    return new_pos;
00081 }

const Anp::CoordXYZ Anp::gnumi_to_near ( const CoordXYZ  pos  ) 

Definition at line 49 of file Default.cxx.

References GNUMICosZ, GNUMINearX, GNUMINearZ, GNUMISinZ, Anp::CoordXYZ::x, Anp::CoordXYZ::y, and Anp::CoordXYZ::z.

00050 {
00051    CoordXYZ new_pos;
00052    
00053    new_pos.x =   pos.x + GNUMINearX;
00054    new_pos.z =  (pos.z - GNUMINearZ) * GNUMICosZ + pos.y * GNUMISinZ;
00055    new_pos.y = -(pos.z - GNUMINearZ) * GNUMISinZ + pos.y * GNUMICosZ;
00056 
00057    return new_pos;
00058 }

Anp::TrackIter Anp::LongestTrack ( const Event event,
const Record &  record 
)

Definition at line 17 of file Utils.cxx.

References Anp::Event::MatchTrack(), Anp::Record::TrackBeg(), and Anp::Record::TrackEnd().

Referenced by Anp::RunkNN::AddData(), Anp::FillEvent::Fill(), Anp::PlotShort::FillStandard(), Anp::SelectKinem::Pass(), Anp::PlotData::Plot(), Anp::PlotShortSelect::Plot(), Anp::PlotShort::PlotStandard(), PrimaryShower(), Anp::FillkNN::Run(), Anp::SelectNuMu::Run(), Anp::FillShortEvent::Run(), Anp::FillShortVar::Run(), Anp::PlotVtx::Run(), Anp::FillEnergy::Run(), Anp::SelectFiducial::Run(), Anp::PlotEvent::Run(), Anp::SelectNC::Run(), Anp::SelectShort::Run(), Anp::PlotBasic::Run(), Anp::FillMadId::Run(), Anp::FillMuonId::Run(), Anp::PlotTrack::Run(), Anp::SelectAntiNeutrino::Run1(), and Anp::SelectAntiNeutrino::Run2().

00018 {
00019    //
00020    // Find longest track that belongs this reconstructed event
00021    //
00022 
00023    TrackIter ltrack = record.TrackEnd();
00024 
00025    for(TrackIter itrack = record.TrackBeg(); itrack != record.TrackEnd(); ++itrack)
00026    {
00027       if(!event.MatchTrack(itrack -> TrackIndex()))
00028       {
00029          continue;
00030       }
00031 
00032       if(ltrack == record.TrackEnd())
00033       {
00034          ltrack = itrack;
00035       }
00036       else if(ltrack -> GetBasic().NPlaneScint() < itrack -> GetBasic().NPlaneScint())
00037       {
00038          ltrack = itrack;
00039       }
00040    }
00041 
00042    return ltrack;
00043 }

double Anp::m_delta (  )  [inline]

Definition at line 134 of file RecoNu.h.

Referenced by m_delta2().

00134 { return 1.232; }

double Anp::m_delta2 (  )  [inline]

Definition at line 138 of file RecoNu.h.

References m_delta().

Referenced by Anp::RecoNu::ERES().

00138 { return Anp::m_delta()  * Anp::m_delta(); }

double Anp::m_muon (  )  [inline]

Definition at line 133 of file RecoNu.h.

Referenced by m_muon2().

00133 { return 0.1056584; }

double Anp::m_muon2 (  )  [inline]
double Anp::m_proton (  )  [inline]

Definition at line 132 of file RecoNu.h.

Referenced by Anp::RecoNu::EQES(), Anp::RecoNu::ERES(), m_proton2(), RecoW2(), Anp::RecoNu::W2(), and Anp::RecoNu::X().

00132 { return 0.9382720; }

double Anp::m_proton2 (  )  [inline]

Definition at line 136 of file RecoNu.h.

References m_proton().

Referenced by Anp::RecoNu::EQES(), RecoW2(), and Anp::RecoNu::W2().

00136 { return Anp::m_proton() * Anp::m_proton(); }

TH1* Anp::MakeTH1 ( const std::string &  dir,
TDirectory *  dir_,
const std::string &  key 
)

Referenced by Anp::PlotTrackGeom::Set().

TH2* Anp::MakeTH2 ( const std::string &  dir,
TDirectory *  dir_,
const std::string &  key 
)
template<typename T >
Bin< T > Anp::Merge ( const Bin< T > &  lhs,
const Bin< T > &  rhs 
) [inline]

Definition at line 334 of file Hist1d.h.

References Anp::Bin< T >::bin(), Anp::Bin< T >::edge(), Anp::Bin< T >::entries(), Anp::Bin< T >::set_ent(), Anp::Bin< T >::set_sum(), Anp::Bin< T >::sum(), and Anp::Bin< T >::sum2().

00335    {
00336       Bin<T> bin(std::min<unsigned int>(lhs.bin(), rhs.bin()),
00337                  std::min<T>(lhs.edge(), rhs.edge()));
00338 
00339       bin.set_sum(lhs.sum() + rhs.sum(), lhs.sum2() + rhs.sum2());
00340       bin.set_ent(lhs.entries() + rhs.entries());
00341 
00342       return bin;
00343    }

template<class T >
unsigned int Anp::NameWidth ( const std::vector< AlgCaddy< T > > &  vec  )  [inline]

Definition at line 60 of file AlgCaddy.h.

References it, and size.

Referenced by Anp::SelectCount::End().

00061    {
00062       unsigned int width = 0;      
00063       for(typename std::vector<AlgCaddy<T> >::const_iterator it = vec.begin(); it != vec.end(); ++it)
00064       {
00065          width = std::max<unsigned int>(width, (it -> name).size());
00066       }
00067 
00068       return width;
00069    }

const Anp::CoordXYZ Anp::near_to_gnumi ( const CoordXYZ  pos  ) 

Definition at line 61 of file Default.cxx.

References GNUMICosZ, GNUMINearX, GNUMINearZ, GNUMISinZ, Anp::CoordXYZ::x, Anp::CoordXYZ::y, and Anp::CoordXYZ::z.

00062 {
00063    CoordXYZ new_pos;
00064    
00065    new_pos.x = pos.x - GNUMINearX;
00066    new_pos.z = pos.z * GNUMICosZ - pos.y * GNUMISinZ + GNUMINearZ;
00067    new_pos.y = pos.z * GNUMISinZ + pos.y * GNUMICosZ;
00068 
00069    return new_pos;
00070 }

template<class T >
unsigned int Anp::NumbWidth ( const std::vector< AlgCaddy< T > > &  vec  )  [inline]

Definition at line 72 of file AlgCaddy.h.

References it.

Referenced by Anp::SelectCount::End().

00073    {
00074       unsigned int width = 0;      
00075       for(typename std::vector<AlgCaddy<T> >::const_iterator it = vec.begin(); it != vec.end(); ++it)
00076       {
00077          width = std::max<unsigned int>(width, it -> Width(it -> NSnarlAll));
00078          width = std::max<unsigned int>(width, it -> Width(it -> NSnarlOut));
00079          width = std::max<unsigned int>(width, it -> Width(it -> NEventAll));
00080          width = std::max<unsigned int>(width, it -> Width(it -> NEventAll));
00081          width = std::max<unsigned int>(width, it -> Width(static_cast<unsigned int>(it -> WEventAll)));
00082          width = std::max<unsigned int>(width, it -> Width(static_cast<unsigned int>(it -> WEventOut)));
00083       }
00084 
00085       return width;
00086    }

bool Anp::operator!= ( const Header lhs,
const Header rhs 
)

Definition at line 436 of file Header.cxx.

00437 {
00438    return !(lhs == rhs);
00439 }

bool Anp::operator< ( const StripLink  A,
const StripLink  B 
) [inline]

Definition at line 45 of file StripLink.h.

00045                                                                 {
00046        StripIter sA = (A).strip;
00047        StripIter sB = (B).strip;
00048        return (sA->GetStrip() < sB->GetStrip());
00049      }

bool Anp::operator< ( const PlaneHitColl &  lhs,
const short  rhs 
) [inline]

Definition at line 152 of file PmtHit.h.

References Anp::PlaneHitColl::GetPlane().

00153    {
00154       return lhs.GetPlane() < rhs;
00155    }

bool Anp::operator< ( const short  lhs,
const PlaneHitColl &  rhs 
) [inline]

Definition at line 148 of file PmtHit.h.

References Anp::PlaneHitColl::GetPlane().

00149    {
00150       return lhs < rhs.GetPlane();
00151    }

bool Anp::operator< ( const PlaneHitColl &  lhs,
const PlaneHitColl &  rhs 
) [inline]

Definition at line 139 of file PmtHit.h.

References Anp::PlaneHitColl::GetPlane().

00140    {
00141       return lhs.GetPlane() < rhs.GetPlane();
00142    }

bool Anp::operator< ( const FitPoint &  rhs,
double  value 
)

Definition at line 200 of file FitPoint.cxx.

References Anp::FitPoint::X().

00201 {
00202    return (fit.X() < value);
00203 }

bool Anp::operator< ( double  value,
const FitPoint &  fit 
)

Definition at line 206 of file FitPoint.cxx.

References Anp::FitPoint::X().

00207 {
00208    return (value < fit.X());
00209 }

bool Anp::operator< ( const FitPoint &  lhs,
const FitPoint &  rhs 
)

Definition at line 194 of file FitPoint.cxx.

References Anp::FitPoint::X().

00195 {
00196    return (lhs.X() < rhs.X());
00197 }

template<typename T >
bool Anp::operator< ( unsigned int  bin,
const Bin< T > &  rhs 
) [inline]

Definition at line 281 of file Hist1d.h.

00281 { return lhs < rhs.bin(); } 

template<typename T >
bool Anp::operator< ( const Bin< T > &  lhs,
unsigned int  bin 
) [inline]

Definition at line 278 of file Hist1d.h.

00278 { return lhs.bin() < rhs; }

template<typename T >
bool Anp::operator< ( const T &  lhs,
const Bin< T > &  rhs 
) [inline]

Definition at line 275 of file Hist1d.h.

00275 { return lhs < rhs.edge(); }  

template<typename T >
bool Anp::operator< ( const Bin< T > &  lhs,
const T &  rhs 
) [inline]

Definition at line 272 of file Hist1d.h.

00272 { return lhs.edge() < rhs; }

template<typename T >
bool Anp::operator< ( const Bin< T > &  lhs,
const Bin< T > &  rhs 
) [inline]

Definition at line 269 of file Hist1d.h.

00269 { return lhs.bin() < rhs.bin(); }

bool Anp::operator< ( const DataNPlane &  lhs,
const DataNPlane &  rhs 
)

Definition at line 179 of file FillNPlane.cxx.

References Anp::DataNPlane::plane.

00180 {
00181    return (lhs.plane < rhs.plane);
00182 }

template<class K , class D >
bool Anp::operator< ( const K &  lhs,
const DataItem< K, D > &  rhs 
) [inline]

Definition at line 115 of file DataItem.h.

00116    {
00117       return (lhs < rhs.Key());
00118    }

template<class K , class D >
bool Anp::operator< ( const DataItem< K, D > &  lhs,
const K &  rhs 
) [inline]

Definition at line 109 of file DataItem.h.

00110    {
00111       return (lhs.Key() < rhs);
00112    }

template<class K , class D >
bool Anp::operator< ( const DataItem< K, D > &  lhs,
const DataItem< K, D > &  rhs 
) [inline]

Definition at line 103 of file DataItem.h.

00104    {
00105       return (lhs.Key() < rhs.Key());
00106    }

template<typename T >
std::ostream& Anp::operator<< ( std::ostream &  o,
const KeyPair< T > &  self 
) [inline]

Definition at line 102 of file KeyPair.h.

00103    {
00104       self.Print(o);
00105       return o;
00106    }

template<typename T >
std::ostream& Anp::operator<< ( std::ostream &  o,
const Hist1d< T > &  self 
) [inline]

Definition at line 1021 of file Hist1d.h.

01022    {
01023       self.Print(o);
01024       return o;
01025    }

template<typename T >
std::ostream& Anp::operator<< ( std::ostream &  o,
const Bin< T > &  self 
) [inline]

Definition at line 290 of file Hist1d.h.

00291    {
00292       self.print(o);
00293       return o;
00294    }

ostream & Anp::operator<< ( std::ostream &  o,
const AxisInfo &  self 
)

Definition at line 1039 of file PhysicsNtuple/HEAD/Hist/HistMan.cxx.

01040 {
01041    self.Print(o);
01042    return o;
01043 }

std::ostream& Anp::operator<< ( std::ostream &  o,
const HistInfo &  self 
)
std::ostream & Anp::operator<< ( std::ostream &  o,
const Header self 
)

Definition at line 442 of file Header.cxx.

00443 {
00444    self.Print(o);
00445    return o;
00446 }

template<typename T >
std::ostream& Anp::operator<< ( std::ostream &  o,
const Handle< T > &  handle 
) [inline]

Handle<T> can be printed with "cout << handle;"

Definition at line 259 of file PhysicsNtuple/HEAD/Handle.h.

00260 {
00261    o << *handle;
00262    return o;
00263 }

std::ostream & Anp::operator<< ( std::ostream &  os,
const Data &  data 
) [inline]

Definition at line 138 of file DataItem.h.

References Anp::DataItem< K, D >::Data(), and Anp::DataItem< K, D >::Key().

00139    {
00140       os  << "data[" << data.Key() << "]=" << data.Data();
00141       return os;
00142    }

bool Anp::operator== ( const TruthReco &  truth,
const Shower &  shower 
)

Definition at line 111 of file TruthReco.cxx.

References Anp::TruthReco::IsShower(), Anp::TruthReco::RecoIndex(), and Anp::Shower::ShowerIndex().

00112 {  
00113    return (truth.IsShower() && truth.RecoIndex() == shower.ShowerIndex());
00114 }

bool Anp::operator== ( const Shower &  shower,
const TruthReco &  truth 
)

Definition at line 107 of file TruthReco.cxx.

References Anp::TruthReco::IsShower(), Anp::TruthReco::RecoIndex(), and Anp::Shower::ShowerIndex().

00108 {   
00109    return (truth.IsShower() && truth.RecoIndex() == shower.ShowerIndex());
00110 }   

bool Anp::operator== ( const TruthReco &  truth,
const RecoNu &  event 
)

Definition at line 87 of file TruthReco.cxx.

References Anp::TruthReco::IsEvent(), and Anp::TruthReco::RecoIndex().

00088 { 
00089    return (truth.IsEvent() && truth.RecoIndex() == event.Index());
00090 }

bool Anp::operator== ( const RecoNu &  event,
const TruthReco &  truth 
)

Definition at line 91 of file TruthReco.cxx.

References Anp::TruthReco::IsEvent(), and Anp::TruthReco::RecoIndex().

00092 { 
00093    return (truth.IsEvent() && truth.RecoIndex() == event.Index());
00094 }

bool Anp::operator== ( const TruthReco &  truth,
const Track &  track 
)

Definition at line 101 of file TruthReco.cxx.

References Anp::TruthReco::IsTrack(), Anp::TruthReco::RecoIndex(), and Anp::Track::TrackIndex().

00102 {  
00103    return (truth.IsTrack() && truth.RecoIndex() == track.TrackIndex());
00104 }

bool Anp::operator== ( const Track &  track,
const TruthReco &  truth 
)

Definition at line 97 of file TruthReco.cxx.

References Anp::TruthReco::IsTrack(), Anp::TruthReco::RecoIndex(), and Anp::Track::TrackIndex().

00098 {   
00099    return (truth.IsTrack() && truth.RecoIndex() == track.TrackIndex());
00100 }   

bool Anp::operator== ( const TruthReco &  truth,
const Event event 
)

Definition at line 77 of file TruthReco.cxx.

References Anp::TruthReco::IsEvent(), and Anp::TruthReco::RecoIndex().

00078 { 
00079    return (truth.IsEvent() && truth.RecoIndex() == event.EventIndex());
00080 }

bool Anp::operator== ( const Event event,
const TruthReco &  truth 
)

Definition at line 81 of file TruthReco.cxx.

References Anp::TruthReco::IsEvent(), and Anp::TruthReco::RecoIndex().

00082 { 
00083    return (truth.IsEvent() && truth.RecoIndex() == event.EventIndex());
00084 }

bool Anp::operator== ( const Truth &  truth,
const Shower &  shower 
) [inline]

Definition at line 336 of file Truth.h.

References Anp::Truth::Find(), and Anp::Truth::RecoEnd().

00337    {  
00338       return (truth.Find(shower) != truth.RecoEnd());
00339    }

bool Anp::operator== ( const Shower &  shower,
const Truth &  truth 
) [inline]

Definition at line 332 of file Truth.h.

References Anp::Truth::Find(), and Anp::Truth::RecoEnd().

00333    {   
00334       return (truth.Find(shower) != truth.RecoEnd());
00335    }   

bool Anp::operator== ( const Truth &  truth,
const Track &  track 
) [inline]

Definition at line 327 of file Truth.h.

References Anp::Truth::Find(), and Anp::Truth::RecoEnd().

00328    {  
00329       return (truth.Find(track) != truth.RecoEnd());
00330    }

bool Anp::operator== ( const Track &  track,
const Truth &  truth 
) [inline]

Definition at line 323 of file Truth.h.

References Anp::Truth::Find(), and Anp::Truth::RecoEnd().

00324    {   
00325       return (truth.Find(track) != truth.RecoEnd());
00326    }   

bool Anp::operator== ( const Truth &  truth,
const RecoNu &  reco 
) [inline]

Definition at line 318 of file Truth.h.

References Anp::Truth::Find(), and Anp::Truth::RecoEnd().

00319    {
00320       return (truth.Find(reco) != truth.RecoEnd());
00321    }

bool Anp::operator== ( const RecoNu &  reco,
const Truth &  truth 
) [inline]

Definition at line 314 of file Truth.h.

References Anp::Truth::Find(), and Anp::Truth::RecoEnd().

00315    {
00316       return (truth.Find(reco) != truth.RecoEnd());
00317    }

bool Anp::operator== ( const Truth &  truth,
const Event event 
) [inline]

Definition at line 305 of file Truth.h.

References Anp::Truth::Find(), and Anp::Truth::RecoEnd().

00306    { 
00307       return (truth.Find(event) != truth.RecoEnd());
00308    }   

bool Anp::operator== ( const Event event,
const Truth &  truth 
) [inline]

Definition at line 309 of file Truth.h.

References Anp::Truth::Find(), and Anp::Truth::RecoEnd().

00310    { 
00311       return (truth.Find(event) != truth.RecoEnd());
00312    }

bool Anp::operator== ( const Truth &  lhs,
const Truth &  rhs 
) [inline]

Definition at line 300 of file Truth.h.

References Anp::Truth::TruthIndex().

00301    {
00302       return (lhs.TruthIndex() == rhs.TruthIndex());
00303    }

bool Anp::operator== ( const Truth &  truth,
short  index 
) [inline]

Definition at line 296 of file Truth.h.

References Anp::Truth::TruthIndex().

00297    {
00298       return (index == truth.TruthIndex());
00299    }

bool Anp::operator== ( short  index,
const Truth &  truth 
) [inline]

Definition at line 292 of file Truth.h.

References Anp::Truth::TruthIndex().

00293    {
00294       return (index == truth.TruthIndex());
00295    }

bool Anp::operator== ( const RecoNu &  rnu,
const TrueNu &  tnu 
) [inline]

Definition at line 179 of file TrueNu.h.

References Anp::TrueNu::Match().

00180    {
00181       return tnu.Match(rnu);
00182    }

bool Anp::operator== ( const TrueNu &  tnu,
const RecoNu &  rnu 
) [inline]

Definition at line 175 of file TrueNu.h.

References Anp::TrueNu::Match().

00176    {   
00177       return tnu.Match(rnu);
00178    }

bool Anp::operator== ( const TrueNu &  lhs,
const TrueNu &  rhs 
) [inline]

Definition at line 171 of file TrueNu.h.

References Anp::TrueNu::Index().

00172    {
00173       return (lhs.Index() == rhs.Index());
00174    }

bool Anp::operator== ( const TrueNu &  reco,
short  index 
) [inline]

Definition at line 167 of file TrueNu.h.

References Anp::TrueNu::Index().

00168    {
00169       return (index == reco.Index());
00170    }

bool Anp::operator== ( short  index,
const TrueNu &  reco 
) [inline]

Definition at line 163 of file TrueNu.h.

References Anp::TrueNu::Index().

00164    {
00165       return (index == reco.Index());
00166    }

bool Anp::operator== ( const Track &  lhs,
const Track &  rhs 
) [inline]

Definition at line 159 of file Track.h.

References Anp::Track::TrackIndex().

00160    {
00161       return (lhs.TrackIndex() == rhs.TrackIndex());
00162    }

bool Anp::operator== ( const Track &  track,
short  index 
) [inline]

Definition at line 155 of file Track.h.

References Anp::Track::TrackIndex().

00156    {
00157       return (index == track.TrackIndex());
00158    }

bool Anp::operator== ( short  index,
const Track &  track 
) [inline]

Definition at line 151 of file Track.h.

References Anp::Track::TrackIndex().

00152    {
00153       return (index == track.TrackIndex());
00154    }

bool Anp::operator== ( const Strip &  lhs,
const Strip &  rhs 
) [inline]

Definition at line 228 of file PhysicsNtuple/HEAD/Strip.h.

References Anp::Strip::Index().

00229    {
00230       return (lhs.Index() == rhs.Index());
00231    }

bool Anp::operator== ( const Strip &  strip,
short  index 
) [inline]

Definition at line 224 of file PhysicsNtuple/HEAD/Strip.h.

References Anp::Strip::Index().

00225    {
00226       return (index == strip.Index());
00227    }

bool Anp::operator== ( short  index,
const Strip &  strip 
) [inline]

Definition at line 220 of file PhysicsNtuple/HEAD/Strip.h.

References Anp::Strip::Index().

00221    {
00222       return (index == strip.Index());
00223    }

bool Anp::operator== ( const Shower &  lhs,
const Shower &  rhs 
) [inline]

Definition at line 120 of file Shower.h.

References Anp::Shower::ShowerIndex().

00121    {
00122       return (lhs.ShowerIndex() == rhs.ShowerIndex());
00123    }

bool Anp::operator== ( const Shower &  shower,
short  index 
) [inline]

Definition at line 116 of file Shower.h.

References Anp::Shower::ShowerIndex().

00117    {
00118       return (index == shower.ShowerIndex());
00119    }

bool Anp::operator== ( short  index,
const Shower &  shower 
) [inline]

Definition at line 112 of file Shower.h.

References Anp::Shower::ShowerIndex().

00113    {
00114       return (index == shower.ShowerIndex());
00115    }

bool Anp::operator== ( const RunSubrun &  lhs,
const RunSubrun &  rhs 
)

Definition at line 430 of file SelectSpill.cxx.

References Anp::RunSubrun::run, and Anp::RunSubrun::subrun.

00431 {
00432    if(lhs.run < 0 || rhs.run < 0)
00433    {
00434       return false;
00435    }
00436 
00437    if(lhs.run == rhs.run)
00438    {
00439       if(lhs.subrun == rhs.subrun)
00440       {
00441          return true;
00442       }
00443       else if(lhs.subrun < 0 || rhs.subrun < 0)
00444       {
00445          return true;
00446       }
00447    }
00448    
00449    return false;
00450 }

bool Anp::operator== ( const RecoNu &  lhs,
const RecoNu &  rhs 
) [inline]

Definition at line 225 of file RecoNu.h.

References Anp::RecoNu::Index().

00226    {
00227       return (lhs.Index() == rhs.Index());
00228    }

bool Anp::operator== ( const RecoNu &  rnu,
short  index 
) [inline]

Definition at line 221 of file RecoNu.h.

References Anp::RecoNu::Index().

00222    {
00223       return (index == rnu.Index());
00224    }

bool Anp::operator== ( short  index,
const RecoNu &  rnu 
) [inline]

Definition at line 217 of file RecoNu.h.

References Anp::RecoNu::Index().

00218    {
00219       return (index == rnu.Index());
00220    }

bool Anp::operator== ( const PlaneHitColl &  lhs,
const short  rhs 
) [inline]

Definition at line 161 of file PmtHit.h.

References Anp::PlaneHitColl::GetPlane().

00162    {
00163       return lhs.GetPlane() == rhs;
00164    }

bool Anp::operator== ( const short  lhs,
const PlaneHitColl &  rhs 
) [inline]

Definition at line 157 of file PmtHit.h.

References Anp::PlaneHitColl::GetPlane().

00158    {
00159       return lhs == rhs.GetPlane();
00160    }

bool Anp::operator== ( const PlaneHitColl &  lhs,
const PlaneHitColl &  rhs 
) [inline]

Definition at line 143 of file PmtHit.h.

References Anp::PlaneHitColl::GetPlane().

00144    {
00145       return lhs.GetPlane() == rhs.GetPlane();
00146    }

bool Anp::operator== ( const Anp::Handle< Anp::CountHist > &  lhs,
const Anp::Handle< Anp::CountHist > &  rhs 
)

Definition at line 185 of file CountHist.cxx.

References OscFit::GetInteraction(), and Anp::Handle< T >::valid().

00186 {
00187    if(!lhs.valid() || !rhs.valid())
00188    {
00189       return false;
00190    }
00191 
00192    if(lhs -> GetInteraction() != rhs -> GetInteraction())
00193    {
00194       return false;
00195    }
00196 
00197    if(lhs -> GetReson() != rhs -> GetReson())
00198    {
00199       return false;
00200    }
00201 
00202    if(lhs -> GetParticle() != rhs -> GetParticle())
00203    {
00204       return false;
00205    }   
00206    
00207    return true;
00208 }

bool Anp::operator== ( const MRCCInfo lhs,
const MRCCInfo rhs 
) [inline]

Definition at line 84 of file PhysicsNtuple/HEAD/MRCCInfo.h.

References Anp::MRCCInfo::MRCCInfoIndex().

00085   {
00086     return (lhs.MRCCInfoIndex() == rhs.MRCCInfoIndex());
00087   }

bool Anp::operator== ( const MRCCInfo mrccin,
short  index 
) [inline]

Definition at line 79 of file PhysicsNtuple/HEAD/MRCCInfo.h.

References Anp::MRCCInfo::MRCCInfoIndex().

00080     {
00081       return (index == mrccin.MRCCInfoIndex());
00082     }

bool Anp::operator== ( short  index,
const MRCCInfo mrccin 
) [inline]

Definition at line 75 of file PhysicsNtuple/HEAD/MRCCInfo.h.

References Anp::MRCCInfo::MRCCInfoIndex().

00076     {
00077       return (index == mrccin.MRCCInfoIndex());
00078     }

bool Anp::operator== ( const FitPoint &  fit,
int  index 
)

Definition at line 218 of file FitPoint.cxx.

References Anp::FitPoint::Index().

00219 {
00220    return (index == fit.Index());
00221 }

bool Anp::operator== ( int  index,
const FitPoint &  fit 
)

Definition at line 212 of file FitPoint.cxx.

References Anp::FitPoint::Index().

00213 {
00214    return (index == fit.Index());
00215 }

bool Anp::operator== ( const FitPoint &  lhs,
const FitPoint &  rhs 
)

Definition at line 188 of file FitPoint.cxx.

References Anp::FitPoint::Index().

00189 {
00190    return (lhs.Index() == rhs.Index());
00191 }

template<typename T >
bool Anp::operator== ( unsigned int  bin,
const Bin< T > &  rhs 
) [inline]

Definition at line 287 of file Hist1d.h.

References Anp::Bin< T >::bin().

00287 { return lhs == rhs.bin(); } 

template<typename T >
bool Anp::operator== ( const Bin< T > &  lhs,
unsigned int  bin 
) [inline]

Definition at line 284 of file Hist1d.h.

References Anp::Bin< T >::bin().

00284 { return lhs.bin() == rhs; }

bool Anp::operator== ( const Header lhs,
const Header rhs 
)

Definition at line 417 of file Header.cxx.

References Anp::Header::Run(), Anp::Header::Snarl(), and Anp::Header::SubRun().

00418 {
00419    if(lhs.Run() != rhs.Run())
00420    {
00421       return false;
00422    }
00423    else if(lhs.SubRun() != rhs.SubRun())
00424    {
00425       return false;
00426    }
00427    else if(lhs.Snarl() != rhs.Snarl())
00428    {
00429       return false;
00430    }
00431 
00432    return true;
00433 }

bool Anp::operator== ( const CountPlaneStrip &  lhs,
const CountPlaneStrip &  rhs 
)

Definition at line 228 of file FillSnarl.cxx.

References Anp::CountPlaneStrip::GetPlane(), and Anp::CountPlaneStrip::GetStrip().

00229 {
00230    if(lhs.GetPlane() == rhs.GetPlane() && lhs.GetStrip() == rhs.GetStrip())
00231    {
00232       return true;
00233    }
00234    
00235    return false;
00236 }

bool Anp::operator== ( const DataNPlane &  lhs,
const DataNPlane &  rhs 
)

Definition at line 185 of file FillNPlane.cxx.

References Anp::DataNPlane::plane.

00186 {
00187    return (lhs.plane == rhs.plane);
00188 }

bool Anp::operator== ( const Event event,
const Track &  track 
)

Definition at line 143 of file PhysicsNtuple/HEAD/Event.cxx.

References Anp::Track::TrackIndex().

00144 {
00145    return event.MatchTrack(track.TrackIndex());
00146 }

bool Anp::operator== ( const Track &  track,
const Event event 
)

Definition at line 137 of file PhysicsNtuple/HEAD/Event.cxx.

References Anp::Track::TrackIndex().

00138 {
00139    return event.MatchTrack(track.TrackIndex());
00140 }

bool Anp::operator== ( const Shower &  shower,
const Event event 
)

Definition at line 131 of file PhysicsNtuple/HEAD/Event.cxx.

References Anp::Shower::ShowerIndex().

00132 {
00133    return event.MatchShower(shower.ShowerIndex());
00134 }

bool Anp::operator== ( const Event event,
const Shower &  shower 
)

Definition at line 125 of file PhysicsNtuple/HEAD/Event.cxx.

References Anp::Shower::ShowerIndex().

00126 {
00127    return event.MatchShower(shower.ShowerIndex());
00128 }

bool Anp::operator== ( const Event lhs,
const Event rhs 
) [inline]

Definition at line 166 of file PhysicsNtuple/HEAD/Event.h.

References Anp::Event::EventIndex().

00167    {
00168       return (lhs.EventIndex() == rhs.EventIndex());
00169    }

bool Anp::operator== ( const Event event,
short  index 
) [inline]

Definition at line 162 of file PhysicsNtuple/HEAD/Event.h.

References Anp::Event::EventIndex().

00163    {
00164       return (index == event.EventIndex());
00165    }

bool Anp::operator== ( short  index,
const Event event 
) [inline]

Definition at line 158 of file PhysicsNtuple/HEAD/Event.h.

References Anp::Event::EventIndex().

00159    {
00160       return (index == event.EventIndex());
00161    }

template<class K , class D >
bool Anp::operator== ( const K &  lhs,
const DataItem< K, D > &  rhs 
) [inline]

Definition at line 133 of file DataItem.h.

References Anp::DataItem< K, D >::Key().

00134    {
00135       return (lhs == rhs.Key());
00136    }

template<class K , class D >
bool Anp::operator== ( const DataItem< K, D > &  lhs,
const K &  rhs 
) [inline]

Definition at line 127 of file DataItem.h.

References Anp::DataItem< K, D >::Key().

00128    {
00129       return (lhs.Key() == rhs);
00130    }

template<class K , class D >
bool Anp::operator== ( const DataItem< K, D > &  lhs,
const DataItem< K, D > &  rhs 
) [inline]

Definition at line 121 of file DataItem.h.

References Anp::DataItem< K, D >::Key().

00122    {
00123       return (lhs.Key() == rhs.Key());
00124    }

double Anp::pi (  )  [inline]

Definition at line 87 of file Default.h.

Referenced by angle().

00087 { return 3.1415926536; }

Anp::ShowerIter Anp::PrimaryShower ( const Event event,
const Record &  record 
)

Definition at line 64 of file Utils.cxx.

References FirstShower(), LongestTrack(), Anp::Record::ShowerEnd(), Anp::Record::TrackEnd(), and MinosMaterial::Z().

Referenced by Anp::FillEvent::Fill(), GetUVAssymForQES(), Anp::PlotVtx::Run(), Anp::PlotShower::Run(), and Anp::PlotBasic::Run().

00065 {
00066    //
00067    // Find primary event shower: !!!hardcoded constants!!!
00068    //
00069 
00070    const ShowerIter ishower = Anp::FirstShower(event, record);
00071    if(ishower == record.ShowerEnd())
00072    {
00073       return record.ShowerEnd();
00074    }
00075 
00076    const TrackIter itrack = Anp::LongestTrack(event, record);   
00077    if(itrack == record.TrackEnd())
00078    {
00079       return ishower;
00080    }
00081    else
00082    {
00083       const double ecut = 2.0; // Minimum shower energy
00084       const double zcut = 0.5; // Maximum z position separation
00085 
00086       if(std::fabs(ishower -> GetVtx().Z() - itrack -> GetBegVtx().Z()) < zcut)
00087       {
00088          return ishower;
00089       }
00090       else if(ishower -> EnergyCC() > ecut)
00091       {
00092          return ishower;
00093       }
00094    }
00095    
00096    return record.ShowerEnd();
00097 }

template<typename T >
void Anp::PrintList ( const std::string &  name,
const std::vector< T > &  lvec 
) [inline]

Definition at line 143 of file Default.h.

00145    {
00146       for(unsigned int ipos = 0; ipos < lvec.size(); ++ipos)
00147       {
00148          if(ipos == 0)
00149          {
00150             std::cout << name << " = " << lvec[ipos];
00151          }
00152          else
00153          {
00154             std::cout << ", " << lvec[ipos];
00155          }
00156 
00157          if(ipos + 1 == lvec.size())
00158          {
00159             std::cout << std::endl;
00160          }       
00161       }
00162    }

void Anp::PrintRecordTruth ( const Record &  record,
std::ostream &  o = std::cout 
)

Definition at line 372 of file Utils.cxx.

References Lit::Print(), Anp::Record::TruthBeg(), and Anp::Record::TruthEnd().

00373 {
00374    for(TruthIter itruth = record.TruthBeg(); itruth != record.TruthEnd(); ++itruth)
00375    {      
00376       itruth -> Print(os);
00377 
00378       for(TruthRecoIter ireco = itruth -> RecoBeg(); ireco != itruth -> RecoEnd(); ++ireco)
00379       {
00380          os << "   ";
00381          ireco -> Print(os);
00382       }
00383    }
00384 }

void Anp::PrintStopWatch ( double  realt,
double  cput 
)

Definition at line 784 of file RunModule.cxx.

References min.

00785 {
00786    const int hours = static_cast<int>(realt/3600.0);
00787    const int  min  = static_cast<int>(realt/60.0) - 60*hours;
00788 
00789    realt -= hours * 3600;
00790    realt -= min * 60;
00791 
00792    if (realt < 0) realt = 0;
00793    if (cput  < 0) cput  = 0;
00794 
00795    const int sec = static_cast<int>(realt);
00796    cout << "Real time " << setw(2) << setfill('0') << hours 
00797         << ":" << setw(2) << setfill('0') << min
00798         << ":" << setw(2) << setfill('0') << sec
00799         << " CPU time " << setprecision(3) << fixed << cput << endl;
00800 }

void Anp::PrintStrips ( const NtpStRecord record,
const int *  index_array,
int  nstrip 
)

Definition at line 610 of file FillBasic.cxx.

References GetSRStrip(), Lit::Print(), and NtpStRecord::stp.

Referenced by TestDataModule::Reco().

00611 {
00612    if(nstrip < 1 || !index_array)
00613    {
00614       return;
00615    }
00616 
00617    const TClonesArray *strip_array = record.stp;
00618    if(!strip_array)
00619    {
00620       cerr << "PrintStrips - NtpStRecord does not have valid strip array." << endl; 
00621       return;
00622    }
00623 
00624    const int entries = strip_array -> GetEntries();
00625 
00626    double raw_east = 0.0, raw_west = 0.0;
00627 
00628    cout << "Printing " << nstrip << " strips of NtpSRStrip type" << endl;
00629 
00630    for(int i = 0; i < nstrip; ++i)
00631    {            
00632       const short index = index_array[i];
00633       if(index < 0 || index >= entries)
00634       {
00635          cerr << "PrintStrips - NtpSRStrip index is out of range: " << index << endl;
00636          continue; 
00637       }
00638 
00639       NtpSRStrip *ntpstp = Anp::GetSRStrip(record, index);
00640       if(!ntpstp)
00641       {
00642          continue;
00643       }
00644     
00645       if(index != ntpstp -> index)
00646       {  
00647          cerr << "PrintStrips - mismatched strip and TClonesArray index" << std::endl;
00648          continue;
00649       }
00650       
00651       if(ntpstp -> pmtindex0 >= 0  && ntpstp -> ph0.raw > 0.0)
00652       {
00653          raw_east += ntpstp -> ph0.raw; 
00654       }
00655       if(ntpstp -> pmtindex1 >= 0 && ntpstp -> ph1.raw > 0.0)
00656       {
00657          raw_west += ntpstp -> ph1.raw; 
00658       }
00659 
00660       cout << "----------------------------------------------------------------------------" << endl;
00661       cout << "NtpSRStrip #" << i + 1 << " raw (east, west) = (" 
00662            <<  ntpstp -> ph0.raw << ", " << ntpstp -> ph1.raw << ")" << endl;
00663       ntpstp -> Print();      
00664    }
00665 
00666    cout << "total raw (east, west, total) = (" << raw_east << ", " << raw_west << ", "
00667         << raw_east + raw_west << ")" << endl;
00668 }

bool Anp::Read ( const Registry reg,
const std::string &  key,
std::string &  value 
)

Definition at line 303 of file Default.cxx.

References Registry::Get().

00304 {
00305    const char *value_char = 0;
00306    if(!reg.Get(key.c_str(), value_char) || !value_char)
00307    {
00308       return false;
00309    }
00310 
00311    value = std::string(value_char);
00312    return true;
00313 }

bool Anp::Read ( const Registry reg,
const std::string &  key,
bool &  value 
)
template<typename T >
std::vector<T> Anp::ReadList ( const Registry reg,
const std::string &  key,
const std::string &  sep 
) [inline]

Definition at line 95 of file Default.h.

References Registry::Get(), and UtilString::StringTok().

00098    {
00099       std::vector<T> lvec;
00100 
00101       const char *list_char = 0;
00102       if(!reg.Get(key.c_str(), list_char) || !list_char)
00103       {
00104          return lvec;
00105       }
00106       
00107       std::vector<std::string> svec;
00108       UtilString::StringTok(svec, list_char, sep.c_str());
00109       
00110       if(svec.empty())
00111       {
00112          return lvec;
00113       }
00114       
00115       for(unsigned int i = 0; i < svec.size(); ++i)
00116       {
00117          std::stringstream valS;
00118          T valT;
00119          
00120          valS << svec[i];
00121          valS >> valT;
00122          
00123          if(valS.fail())
00124          {
00125             std::cerr << "ReadList<T> - stringstream operator>> failed for: " << svec[i] << std::endl;
00126          }
00127          else
00128          {       
00129             lvec.push_back(valT);
00130          }
00131       }
00132       
00133       return lvec;
00134    }

bool Anp::ReadRegistry ( const std::string &  filepath,
Registry reg,
bool  quiet = true 
)

Definition at line 124 of file Default.cxx.

References infile, Registry::KeyExists(), Registry::LockKeys(), Registry::LockValues(), Registry::Set(), Registry::UnLockKeys(), and Registry::UnLockValues().

Referenced by Anp::SelectKinem::Config(), Anp::DrawSnarl::Config(), Anp::SelectNuMu::Config(), Anp::Interface::Config(), and Anp::FiducialCut::Init().

00125 {
00126    if(!quiet)
00127    {
00128       std::cout << "-------------------------------------------------------------" << std::endl;
00129       std::cout << "Configuraton file:" << std::endl << "   " << filepath << std::endl;
00130       std::cout << std::endl;
00131    }
00132 
00133    std::ifstream infile(filepath.c_str());
00134    if(!infile || !infile.is_open())
00135    {
00136       std::cerr << "Anp::ReadRegistry - failed to open file: " << filepath << std::endl;
00137       if(quiet)
00138       {
00139          std::cout << "-------------------------------------------------------------" << std::endl;
00140       }
00141       return false;
00142    }
00143 
00144    reg.UnLockKeys();
00145    reg.UnLockValues();
00146    
00147    while(!infile.eof())
00148    {
00149       std::string line;
00150       std::getline(infile, line);
00151 
00152       if(line.empty() || line.find("#",0) != std::string::npos)
00153       {
00154          continue;
00155       }
00156       
00157       const std::string::size_type nbeg = line.find_first_of("[", 0);
00158       const std::string::size_type nend = line.find_first_of("]", 0);
00159 
00160       if(nbeg == std::string::npos || nend == std::string::npos || !(nbeg < nend))
00161       {
00162          if(!quiet) std::cout << "   Failed to parse name" << std::endl;
00163          continue;
00164       }
00165 
00166       const std::string::size_type vbeg = line.find_first_of("[", nend + 1);
00167       const std::string::size_type vend = line.find_first_of("]", nend + 1);
00168       
00169       if(vbeg == std::string::npos || vend == std::string::npos || !(vbeg < vend))
00170       {
00171          if(!quiet) std::cout << "   Failed to parse value" << std::endl;
00172          continue;
00173       }
00174 
00175       const std::string::size_type tbeg = line.find_first_of("[", vend + 1);
00176       const std::string::size_type tend = line.find_first_of("]", vend + 1);
00177       
00178       if(tbeg == std::string::npos || tend == std::string::npos || !(tbeg < tend))
00179       {
00180          if(!quiet) std::cout << "   Failed to parse type" << std::endl;
00181          continue;
00182       }
00183 
00184       const std::string name  = line.substr(nbeg + 1, nend - nbeg - 1);
00185       const std::string value = line.substr(vbeg + 1, vend - vbeg - 1);
00186       const std::string type  = line.substr(tbeg + 1, tend - tbeg - 1);
00187       
00188       if(!quiet) std:: cout << "   " << name  << " = " << value << " (" << type << ")" << std::endl;
00189 
00190       if(reg.KeyExists(name.c_str()))
00191       {
00192          std::cerr << "Anp::ReadRegistry - key [" << name << "] already exists" << std::endl;
00193          continue;
00194       }
00195 
00196       if(type == "string")
00197       {
00198          reg.Set(name.c_str(), value.c_str());
00199       }
00200       else if(type == "double")
00201       {
00202          const double value_double = std::atof(value.c_str());
00203          reg.Set(name.c_str(), value_double);
00204       }
00205       else if(type == "int")
00206       {
00207          if(value.find(".",0) != std::string::npos)
00208          {
00209             if(!quiet) std::cerr << "   Forcing conversion of double to integer" << std::endl;
00210             const int value_int = static_cast<int>(std::atof(value.c_str()));
00211             reg.Set(name.c_str(), value_int);
00212          }
00213          else
00214          {
00215             const int value_int = std::atoi(value.c_str());
00216             reg.Set(name.c_str(), value_int);
00217          }
00218       }
00219    }
00220    
00221    if(infile.is_open())
00222    {
00223       infile.close();
00224    }
00225 
00226    reg.LockKeys();
00227    reg.LockValues();
00228 
00229    if(!quiet)
00230    {
00231       std::cout << "-------------------------------------------------------------" << std::endl;
00232    }
00233    
00234    return true;
00235 }

const std::vector<RunSubrun> Anp::ReadRunList ( const std::string &  path,
bool  print = false 
)
double Anp::RecoQ2 ( const RecoNu &  rnu,
Reco::Formula  formula 
)

Definition at line 188 of file RecoNu.cxx.

References Anp::RecoNu::CosN(), Anp::RecoNu::ELep(), Anp::RecoNu::ENeu(), Anp::RecoNu::EQES(), Anp::RecoNu::ERES(), Anp::Reco::kQES, Anp::Reco::kRES, and Anp::Reco::kSUM.

Referenced by RecoW2().

00189 {
00190    switch (formula)
00191    {
00192    case Reco::kSUM: return 2.0*rnu.ENeu()*rnu.ELep()*(1-rnu.CosN());
00193    case Reco::kQES: return 2.0*rnu.EQES()*rnu.ELep()*(1-rnu.CosN());
00194    case Reco::kRES: return 2.0*rnu.ERES()*rnu.ELep()*(1-rnu.CosN());
00195    default: break;
00196    }
00197 
00198    cerr << "Anp::RecoQ2 - uknown formula parameter: " << formula << endl;
00199    return 0.0;
00200 }

double Anp::RecoW2 ( const RecoNu &  rnu,
Reco::Formula  formula 
)

Definition at line 203 of file RecoNu.cxx.

References Anp::RecoNu::EHad(), Anp::RecoNu::ELep(), Anp::RecoNu::EQES(), Anp::RecoNu::ERES(), Anp::Reco::kQES, Anp::Reco::kRES, Anp::Reco::kSUM, m_proton(), m_proton2(), and RecoQ2().

00204 {
00205    double ehad = 0.0;
00206    switch (formula)
00207    {
00208       case Reco::kSUM:
00209       {
00210          ehad = rnu.EHad();
00211          break;
00212       }
00213       case Reco::kQES:
00214       {
00215          ehad = rnu.EQES() - rnu.ELep();
00216          break;
00217       }
00218       case Reco::kRES:
00219       {
00220          ehad = rnu.ERES() - rnu.ELep();
00221          break;
00222       }
00223       default:
00224       {
00225          cerr << "Anp::RecoQ2 - uknown formula parameter: " << formula << endl;
00226          return 0.0;
00227       }
00228    }
00229 
00230    if(ehad < 0.0) ehad = 0.0;
00231 
00232    return m_proton2() + 2.0*m_proton()*ehad + Anp::RecoQ2(rnu, formula);
00233 }

void * Anp::run_alg_thread ( void *  data_  ) 

Definition at line 13 of file AlgThread.cxx.

Referenced by Anp::AlgThread::Run().

00014 {
00015    if(!data_)
00016    {
00017       cerr << "Anp::run_alg_thread - null data pointer" << endl;
00018       return 0;
00019    }
00020 
00021    AlgThread *data = static_cast<AlgThread *> (data_);
00022 
00023    data -> Run();
00024 
00025    return data;
00026 }

TH1* Anp::SetDir ( TH1 *  h,
TDirectory *  dir,
const std::string &  name = "" 
)
int Anp::SetKey ( Registry reg,
const std::string &  key,
const std::string &  value 
)

Definition at line 316 of file Default.cxx.

References Registry::Get(), Registry::GetTypeAsString(), Registry::Key(), Registry::KeysLocked(), Registry::LockKeys(), Registry::LockValues(), Registry::Set(), Registry::UnLockKeys(), Registry::UnLockValues(), and Registry::ValuesLocked().

00317 {
00318    //
00319    // Recursively walk through Registry and add "value" at "key"
00320    //
00321    if(key.empty())
00322    {
00323       cerr << "Anp::SetKey - key string is empty" << endl;
00324       return 0;
00325    }
00326    if(value.empty())
00327    {
00328       cerr << "Anp::SetKey - value string is empty" << endl;
00329       return 0;
00330    }
00331 
00332    const bool klock = reg.KeysLocked();
00333    const bool vlock = reg.ValuesLocked();
00334 
00335    if(klock) reg.UnLockKeys();
00336    if(vlock) reg.UnLockValues();
00337    reg.Set(key.c_str(), value.c_str());
00338 
00339    Registry::RegistryKey rkey = reg.Key();
00340    vector<string> rvec;
00341    
00342    const char* charkey = 0;
00343    while( (charkey = rkey()) )
00344    {
00345       if(charkey && reg.GetTypeAsString(charkey) == "Registry")
00346       {
00347          rvec.push_back(charkey);
00348       }
00349    }
00350    
00351    int nadd = 1;
00352    for(vector<string>::const_iterator sit = rvec.begin(); sit != rvec.end(); ++sit)
00353    {
00354       const string &skey = *sit;
00355       
00356       Registry dreg;
00357       if(!reg.Get(skey.c_str(), dreg))
00358       {
00359          cerr << "SelectKinem::GetAlg - failed to get Registry at: " << skey << endl;
00360          continue;
00361       }
00362       
00363       //
00364       // Recursively walk through Registry daughter objects
00365       //
00366       nadd += Anp::SetKey(dreg, key, value);
00367       reg.Set(skey.c_str(), dreg);
00368    }
00369    
00370    if(klock) reg.LockKeys();
00371    if(vlock) reg.LockValues();
00372 
00373    return nadd;
00374 }

float Anp::uv2x ( float  u,
float  v 
) [inline]

Definition at line 81 of file Default.h.

Referenced by Anp::Vertex::CosX(), and Anp::Vertex::X().

00081 { return (u - v)*0.707106781; }

float Anp::uv2y ( float  u,
float  v 
) [inline]

Definition at line 82 of file Default.h.

Referenced by Anp::Vertex::CosY(), and Anp::Vertex::Y().

00082 { return (u + v)*0.707106781; }

float Anp::xy2u ( float  x,
float  y 
) [inline]

Definition at line 84 of file Default.h.

Referenced by Anp::Truth::GetVtx().

00084 { return (y + x)*0.707106781; }

float Anp::xy2v ( float  x,
float  y 
) [inline]

Definition at line 85 of file Default.h.

Referenced by Anp::Truth::GetVtx().

00085 { return (y - x)*0.707106781; }


Variable Documentation

const double Anp::GNUMICosZ = 0.998318471 [static]

Definition at line 44 of file Default.cxx.

Referenced by far_to_gnumi(), gnumi_to_far(), gnumi_to_near(), and near_to_gnumi().

const double Anp::GNUMIFarX = 0.0 [static]

Definition at line 40 of file Default.cxx.

const double Anp::GNUMIFarY = 0.0 [static]

Definition at line 41 of file Default.cxx.

const double Anp::GNUMIFarZ = 735.34E3 [static]

Definition at line 42 of file Default.cxx.

Referenced by far_to_gnumi(), and gnumi_to_far().

const double Anp::GNUMINearX = 1.48844 [static]

Definition at line 36 of file Default.cxx.

Referenced by gnumi_to_near(), and near_to_gnumi().

const double Anp::GNUMINearY = 0.0 [static]

Definition at line 37 of file Default.cxx.

const double Anp::GNUMINearZ = 1036.49 [static]

Definition at line 38 of file Default.cxx.

Referenced by gnumi_to_near(), and near_to_gnumi().

const double Anp::GNUMISinZ = 0.057967487 [static]

Definition at line 45 of file Default.cxx.

Referenced by far_to_gnumi(), gnumi_to_far(), gnumi_to_near(), and near_to_gnumi().

Definition at line 26 of file Default.cxx.

Referenced by GetMainMutex().

Definition at line 25 of file Default.cxx.

Referenced by GetROOTMutex().


Generated on 14 Dec 2017 for loon by  doxygen 1.6.1