Ignore:
Timestamp:
11/06/01 13:27:04 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc

    r1010 r1032  
    6262
    6363    AddToBranchList("fHiGainPixId");
    64     //AddToBranchList("fLoGainPixId");
     64    AddToBranchList("fLoGainPixId");
    6565    AddToBranchList("fHiGainFadcSamples");
    66     //AddToBranchList("fLoGainFadcSamples");
     66    AddToBranchList("fLoGainFadcSamples");
     67
    6768}
    6869
     
    7778//  - MCerPhotEvt
    7879//
    79 Bool_t MCerPhotCalc::PreProcess( MParList *pList )
     80Bool_t MCerPhotCalc::PreProcess(MParList *pList)
    8081{
    8182    fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData");
     
    107108Bool_t MCerPhotCalc::Process()
    108109{
    109     fCerPhotEvt->Clear();
    110 
    111110    MRawEvtPixelIter pixel(fRawEvt);
    112111
    113112    while (pixel.Next())
    114113    {
     114
    115115        const UInt_t pixid = pixel.GetPixelId();
    116116
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc

    r1003 r1032  
    4444MCerPhotEvt::MCerPhotEvt(const char *name, const char *title) : fNumPixels(0)
    4545{
    46 
    47   fName  = name  ? name  : "MCerPhotEvt";
    48   fTitle = title ? title : "(Number of Photon)-Event Information";
    49  
    50   fPixels = new TClonesArray ("MCerPhotPix", 577) ;
    51 
    52   //
    53   // FIXME: is this really necessary?
    54   //
    55   fPixels->Clear();
     46    fName  = name  ? name  : "MCerPhotEvt";
     47    fTitle = title ? title : "(Number of Photon)-Event Information";
     48
     49    fPixels = new TClonesArray ("MCerPhotPix", 577);
     50
     51    //
     52    // FIXME: is this really necessary?
     53    //
     54    Reset();
    5655}
    5756
     
    8281{
    8382    // TClonesArray -> 'operator new with placement' should be used
     83
     84    fPixels->ExpandCreate(fNumPixels);
    8485    new ((*fPixels)[fNumPixels++]) MCerPhotPix(id, nph, err);
    8586}
     
    8990// reset counter and delete netries in list.
    9091//
    91 void MCerPhotEvt::Clear(Option_t *)
     92void MCerPhotEvt::Reset()
    9293{
    9394    fNumPixels = 0;
    94     fPixels->Clear();
     95//    fPixels->Delete();
    9596}
    9697
     
    108109        << endl ;
    109110
    110     for (Int_t il=0; il<entries; il++ )
    111         (*this)[il].Print();
     111    for (Int_t i=0; i<entries; i++ )
     112        (*this)[i].Print();
    112113}
    113114
     
    120121    const Int_t entries = fPixels->GetEntries();
    121122
    122     for (Int_t il=0; il<entries; il++)
    123     {
    124         if (id == (*this)[il].GetPixId())
     123    for (Int_t i=0; i<entries; i++)
     124    {
     125        if (id == (*this)[i].GetPixId())
    125126            return kTRUE;
    126127    }
     
    137138    const Int_t entries = fPixels->GetEntries();
    138139
    139     for (Int_t il=0; il<entries; il++)
    140     {
    141         MCerPhotPix &pix = (*this)[il];
     140    for (Int_t i=0; i<entries; i++)
     141    {
     142        const MCerPhotPix &pix = (*this)[i];
    142143
    143144        if (id == pix.GetPixId() && pix.IsPixelUsed())
     
    156157    const Int_t entries = fPixels->GetEntries();
    157158
    158     for (Int_t il=0; il<entries; il++)
    159     {
    160         MCerPhotPix &pix = (*this)[il];
     159    for (Int_t i=0; i<entries; i++)
     160    {
     161        const MCerPhotPix &pix = (*this)[i];
    161162
    162163        if (id == pix.GetPixId() && pix.IsCorePixel())
     
    178179    Float_t minval = (*this)[0].GetNumPhotons();
    179180
    180     Float_t testval;
    181181    for (UInt_t i=1; i<fNumPixels; i++)
    182182    {
    183         testval = (*this)[i].GetNumPhotons();
     183        const Float_t testval = (*this)[i].GetNumPhotons();
    184184
    185185        if (testval < minval)
     
    201201    Float_t maxval = (*this)[0].GetNumPhotons();
    202202
    203     Float_t testval;
    204203    for (UInt_t i=1; i<fNumPixels; i++)
    205204    {
    206         testval = (*this)[i].GetNumPhotons();
     205        const Float_t testval = (*this)[i].GetNumPhotons();
    207206
    208207        if (testval > maxval)
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h

    r1014 r1032  
    2121    ~MCerPhotEvt() { delete fPixels; }
    2222
    23     void Draw(Option_t* option = "");
    24 
    2523    UInt_t GetNumPixels() const { return fNumPixels; }
    26 
    27     void AddPixel(Int_t id, Float_t nph, Float_t err);
    28 
    29     void Clear(Option_t *opt=NULL);
    30     void Print(Option_t *opt=NULL) const;
     24    void   AddPixel(Int_t id, Float_t nph, Float_t err);
    3125
    3226    Bool_t  IsPixelExisting(Int_t id) const;
     
    4034    MCerPhotPix &operator[](int i) const { return *(MCerPhotPix*)(fPixels->At(i)); }
    4135
     36    void Reset();
     37
     38    void Draw(Option_t* option = "");
     39    void Print(Option_t *opt=NULL) const;
     40    void Clear(Option_t *opt=NULL) { Reset(); }
     41
    4242    ClassDef(MCerPhotEvt, 1)    // class for an event containing cerenkov photons
    4343};
Note: See TracChangeset for help on using the changeset viewer.