Changeset 1118 for trunk


Ignore:
Timestamp:
12/18/01 12:07:26 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1114 r1118  
    11                                                                  -*-*- END -*-*-
     2
     3 2001/12/18: Thomas Bretz
     4 
     5   * manalysis/MMcPedestalCopy.cc:
     6     - changed output
     7     
     8   * manalysis/MMcPedestalNSB.cc:
     9     - changed output
     10     - simplified initialization in PreProcess
     11     
     12   * mbase/MAGIC.h:
     13     - added kSKIP
     14     
     15   * mbase/MParList.cc:
     16     - added a check for the correct inheritance in FindCreateObj
     17   
     18   * mbase/MTask.cc:
     19     - added support for kSKIP in PreProcess
     20
     21   * mbase/MTaskList.[h,cc]
     22     - added support for kSKIP in PreProcess
     23     - added Remove function (private)
     24
     25
     26
     27 2001/12/17: Thomas Bretz
     28 
     29   * .rootrc:
     30     - added Root.Html.DescriptionStyle
     31     - added Root.Html.SearchEngine
     32     
     33   * macros/dohtml.C:
     34     - changed to use THtml (root >= 3.02/06 only)
     35     
     36   * manalysis/Makefile:
     37     - changed order to get rid of some wranings
     38   
     39   * mbase/BaseLinkDef.h:
     40     - removed MHtml
     41     
     42   * mbase/MEvtLoop.cc:
     43     - exchanged gSystem->ProcessEvents() by gClient->ProcessEventsFor()
     44       to make gui update faster
     45       
     46   * mbase/MGList.cc:
     47     - added a missing sanity check (workaround for a root bug)
     48     
     49   * mbase/MReadTree.cc:
     50     - uncomment EnableBranchCoosing for AutoEnablingScheme
     51       (don't know why there was a comment which made things realy slow)
     52     - changed the auto enabling scheme, so that a branch isn't enabled
     53       more than once. This doesn't hurt, but the output may confuse the
     54       users.
     55       
     56    * mbase/MTask.cc:
     57      - added a simple not really necessary check whether the branch is
     58        already in the list
     59       
     60    * mbase/MWriteRootFile.cc:
     61      - changed kFillTree to a local const
     62     
     63    * mbase/Makefile:
     64      - removed MHtml.cc
     65   
     66    * mfilter/MFTriggerLvl1.cc:
     67      - changed AddBranchToList to use the correct container name
     68
     69
    270
    371 2001/12/14: Thomas Bretz
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc

    r1112 r1118  
    6565    MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
    6666    if (run)
    67     {
    6867        if (run->GetRunType() != kRTMonteCarlo)
    6968        {
    70             *fLog << "No Monte Carlo File - MMcPedestalCopy skipped." << endl;
    71             return kTRUE;
     69            *fLog << warn << dbginf << "MMcPedestalCopy is for Monte Carlo files only... removing this task from list." << endl;
     70            return kSKIP;
    7271        }
    73     }
     72    else
     73        *fLog << warn << dbginf << "Warning - cannot check file type, MRawRunHeader not found." << endl;
    7474
    7575    const MMcFadcHeader *mcped = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader");
    7676    if (!mcped)
    7777    {
    78         *fLog << dbginf << "MMcFadcHeader not found... aborting." << endl;
     78        *fLog << warn << dbginf << "MMcFadcHeader not found... aborting." << endl;
    7979        return kFALSE;
    8080    }
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalNSB.cc

    r1097 r1118  
    6060    AddToBranchList("fElecNoise");
    6161
    62     fdnsb_pixel=difnsb;
     62    fdnsb_pixel = difnsb;
    6363}
    6464
     
    6666{
    6767    MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
    68     if (run)
     68    if (!run)
    6969    {
    70         if (run->GetRunType() != kRTMonteCarlo){
    71             *fLog << dbginf << "This task is only for Monte Carlo files, therefore the RunType should be "<<kRTMonteCarlo<<" and it is: "<<run->GetRunType()<<" ... aborting"<<endl;
    72             return kFALSE;
    73         }
    74     }
    75     else
    76     {
    77         *fLog << dbginf << "MRawRunHeader not found... aborting." << endl;
     70        *fLog << err << dbginf << "MRawRunHeader not found... aborting." << endl;
    7871        return kFALSE;
    7972    }
    8073
     74    if (run->GetRunType() != kRTMonteCarlo)
     75    {
     76        *fLog << warn << dbginf << "Warning - MMcPedestalNSB is for Monte Carlo files only... removing this task from list." << endl;
     77        return kSKIP;
     78    }
     79
    8180    const MMcFadcHeader *mcped = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader");
    82 
    8381    if (!mcped)
    8482    {
    85         *fLog << dbginf << "MMcFadcHeader not found... aborting." << endl;
     83        *fLog << err << dbginf << "MMcFadcHeader not found... aborting." << endl;
    8684        return kFALSE;
    8785    }
    8886
    8987    MMcRunHeader *mcrun = (MMcRunHeader*)pList->FindObject("MMcRunHeader");
     88    if (!mcrun && fdnsb_pixel < 0)
     89    {
     90        *fLog << err << dbginf << "Using the default argument of MMcPedestalNSB::MMcPedestalNSB() ";
     91        *fLog << "only allowed if MMcRunHeader is available... aborting." << endl;
     92        return kFALSE;
     93    }
     94
    9095    if (mcrun)
    9196    {
    92         if (fdnsb_pixel >= 0 && fdnsb_pixel != mcrun->GetNumPheFromDNSB()){
    93             *fLog<< dbginf <<endl<< "The MC file has been generated with diffuse nsb : "<<mcrun->GetNumPheFromDNSB()<<" but you set up the diffuse NSB to :"<<fdnsb_pixel<<endl;
    94         fdnsb_pixel = fdnsb_pixel*50.0/15.0;
    95         }
    96         else
    97             fdnsb_pixel = mcrun->GetNumPheFromDNSB()*50.0/15.0;
     97        if (fdnsb_pixel >= 0 && fdnsb_pixel != mcrun->GetNumPheFromDNSB())
     98        {
     99            *fLog << warn << dbginf << "The MC file has been generated with diffuse nsb " << mcrun->GetNumPheFromDNSB();
     100            *fLog <<" but you set up the diffuse NSB to " << fdnsb_pixel << endl;
     101        }
     102
     103        fdnsb_pixel = mcrun->GetNumPheFromDNSB();
    98104    }
    99     else
    100     {
    101         if (fdnsb_pixel < 0 ){
    102             *fLog << dbginf << "MMcRunHeader not found... aborting." << endl;
    103             return kFALSE;
    104         }
    105         else {
    106             *fLog<< dbginf <<endl<< "The MC file has been generated with diffuse nsb : "<<mcrun->GetNumPheFromDNSB()<<" but you set up the diffuse NSB to :"<<fdnsb_pixel<<endl;
    107             fdnsb_pixel = fdnsb_pixel*50.0/15.0;
    108         }
    109     }
     105
     106    fdnsb_pixel *= 50.0/15.0;
    110107
    111108    MPedestalCam *pedcam = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
     
    122119
    123120        const Float_t pedrms = mcped->GetPedestalRms(i);
     121        const Float_t sigrms = pedrms/sqrt(run->GetNumSamplesHiGain()*2);
     122        const Float_t ampl   = mcped->GetAmplitud();
    124123
    125         const Float_t sigrms = pedrms/sqrt(run->GetNumSamplesHiGain()*2);
     124        //
     125        // check for central pixel (i<397)
     126        //
    126127
    127         if (i<397) // Central Pixels
    128         {
    129             pix.SetPedestalRms(sqrt(pedrms*pedrms+fdnsb_pixel*mcped->GetAmplitud()*mcped->GetAmplitud()), sigrms);
    130         }
    131         else
    132         {
    133             pix.SetPedestalRms(sqrt(pedrms*pedrms+fdnsb_pixel*mcped->GetAmplitud()*mcped->GetAmplitud()*4), sigrms);
    134         }
     128        const Double_t value = pedrms*pedrms + fdnsb_pixel*ampl*ampl;
    135129
     130        pix.SetPedestalRms(sqrt(i<397 ? value : value*4), sigrms);
    136131    }
    137132
    138133    return kTRUE;
    139134}
    140 
    141 
    142 
  • trunk/MagicSoft/Mars/mbase/MAGIC.h

    r1027 r1118  
    1717//
    1818const Int_t kCONTINUE = 2;
     19const Int_t kSKIP     = 2;
    1920
    2021//
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r1116 r1118  
    138138    fNumExecutions = 0;
    139139
    140     if (!PreProcess(plist))
     140    switch (PreProcess(plist))
     141    {
     142    case kFALSE:
    141143        return kFALSE;
    142144
    143     fIsPreprocessed = kTRUE;
    144     return kTRUE;
     145    case kTRUE:
     146        fIsPreprocessed = kTRUE;
     147        return kTRUE;
     148
     149    case kSKIP:
     150        return kSKIP;
     151    }
     152
     153    *fLog << err << dbginf << "PreProcess of " << GetDescriptor();
     154    *fLog << " returned an unknown value... aborting." << endl;
     155
     156    return kFALSE;
    145157}
    146158
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r1108 r1118  
    245245// --------------------------------------------------------------------------
    246246//
     247//  removes a task from the list (used in PreProcess).
     248//  if kIsOwner is set the task is deleted. (see SetOwner())
     249//
     250void MTaskList::Remove(MTask *task)
     251{
     252    TObject *obj = fTasks->Remove(task);
     253
     254    if (TestBit(kIsOwner))
     255        delete obj;
     256}
     257
     258// --------------------------------------------------------------------------
     259//
    247260//  do pre processing (before eventloop) of all tasks in the task-list
    248261//
     
    267280        *fLog << all << task->GetName() << "... " << flush;
    268281
    269         if (!task->CallPreProcess(fParList))
     282        switch (task->CallPreProcess(fParList))
     283        {
     284        case kFALSE:
    270285            return kFALSE;
     286
     287        case kTRUE:
     288            continue;
     289
     290        case kSKIP:
     291            Remove(task);
     292            continue;
     293        }
     294
     295        *fLog << err << dbginf << "PreProcess of " << task->GetDescriptor();
     296        *fLog << " returned an unknown value... aborting." << endl;
     297        return kFALSE;
    271298    }
    272299
Note: See TracChangeset for help on using the changeset viewer.