Changeset 14610


Ignore:
Timestamp:
11/13/12 17:20:05 (12 years ago)
Author:
Jens Buss
Message:
aditional verbosity output
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/marsmacros/mc2csv/MonteCarlo.C

    r14605 r14610  
    8282    mSeparator      = " ";
    8383
    84     // Änderung !!!
     84    // source file
    8585    mpRootFile      = NULL;
    86     // Änderung zuende
    87 
     86
     87    // Trees
    8888    mpEventTree     = NULL;
    8989    mpHeaderTree    = NULL;
    90     mpPixel         = NULL;
    91 
    92     // Änderung !!!
     90
     91
     92    //header data types
    9393    mpIntendedPulsePos      = NULL;
    9494    mpMcRunHeader           = NULL;
     
    9797    mpCorsikaRunHeader      = NULL;
    9898
     99    //Evt data types
    99100    mpElectronicNoise       = NULL;
    100101    mpRawEventData          = NULL;
     
    103104    mpRawEventHeader        = NULL;
    104105    mpCorsikaEvtHeader      = NULL;
    105     // Änderung zuende
    106 
     106    //
     107
     108    // containers
     109    mpPixel         = NULL;
    107110    mpSamples       = NULL;
    108111    mEventNumber    = 0;
    109112    mNumberOfEvents = 2;
    110113
    111     mVerbosityLvl   = 0;
     114    mVerbosityLvl   = 2;
    112115
    113116    return;
     
    149152    if (mVerbosityLvl > 0) cout << "...closing root file: " << mFileName << endl;
    150153    mpRootFile->Close("R");
     154    mpRootFile=NULL;
    151155
    152156    return;
     
    188192    }
    189193
    190 
    191 
    192194    //Set Adresses to Branches in RunHeader-Tree
    193     mpHeaderTree->SetBranchAddress("MGeomCam.",         &mpGeomCam);
    194     mpHeaderTree->SetBranchAddress("IntendedPulsePos.", &mpIntendedPulsePos);
    195     mpHeaderTree->SetBranchAddress("MMcRunHeader.",     &mpMcRunHeader);
    196     mpHeaderTree->SetBranchAddress("ElectronicNoise.",  &mpElectronicNoise);
    197     mpHeaderTree->SetBranchAddress("MRawRunHeader.",    &mpRawRunHeader);
    198     mpHeaderTree->SetBranchAddress("MCorsikaRunHeader.",&mpCorsikaRunHeader);
     195    if ( mpHeaderTree->GetBranchStatus("MGeomCam.") )
     196    {
     197        if (mVerbosityLvl > 1) cout << "   ...MGeomCam" << endl;
     198        mpHeaderTree->SetBranchAddress("MGeomCam.",         &mpGeomCam);
     199    }
     200    if ( mpHeaderTree->GetBranchStatus("IntendedPulsePos.") )
     201    {
     202        if (mVerbosityLvl > 1) cout << "   ...IntendedPulsePos" << endl;
     203        mpHeaderTree->SetBranchAddress("IntendedPulsePos.", &mpIntendedPulsePos);
     204    }
     205    if ( mpHeaderTree->GetBranchStatus("MMcRunHeader.") )
     206    {
     207        if (mVerbosityLvl > 1) cout << "   ...MMcRunHeader" << endl;
     208        mpHeaderTree->SetBranchAddress("MMcRunHeader.",     &mpMcRunHeader);
     209    }
     210    if ( mpHeaderTree->GetBranchStatus("ElectronicNoise.") )
     211    {
     212        if (mVerbosityLvl > 1) cout << "   ...ElectronicNoise" << endl;
     213        mpHeaderTree->SetBranchAddress("ElectronicNoise.",  &mpElectronicNoise);
     214    }
     215    if ( mpHeaderTree->GetBranchStatus("MRawRunHeader.") )
     216    {
     217        if (mVerbosityLvl > 1) cout << "   ...MRawRunHeader" << endl;
     218        mpHeaderTree->SetBranchAddress("MRawRunHeader.",    &mpRawRunHeader);
     219    }
     220    if ( mpHeaderTree->GetBranchStatus("MCorsikaRunHeader.") )
     221    {
     222        if (mVerbosityLvl > 1) cout << "   ...MCorsikaRunHeader" << endl;
     223        mpHeaderTree->SetBranchAddress("MCorsikaRunHeader.",&mpCorsikaRunHeader);
     224    }
     225
    199226    return;
    200227}
     
    266293    }
    267294
     295
    268296    //Set Adresses to Branches in Events-Tree
    269     mpEventTree->SetBranchAddress("MRawEvtData.",       &mpRawEventData);
    270     mpEventTree->SetBranchAddress("IncidentAngle.",     &mpIncidentAngle);
    271     mpEventTree->SetBranchAddress("MMcEvt.",            &mpMcEventMetaData);
    272     mpEventTree->SetBranchAddress("MRawEvtHeader.",     &mpRawEventHeader);
    273     mpEventTree->SetBranchAddress("MCorsikaEvtHeader.", &mpCorsikaEvtHeader);
     297    if (mVerbosityLvl > 1) cout << "...SetBranchAddresses:" << endl;
     298
     299    if ( mpEventTree->GetBranchStatus("MRawEvtData.") != -1 )
     300    {
     301        if (mVerbosityLvl > 1) cout << "   ...MRawEvtData" << endl;
     302        mpEventTree->SetBranchAddress("MRawEvtData.",       &mpRawEventData);
     303    }
     304    if ( mpEventTree->GetBranchStatus("IncidentAngle.") )
     305    {
     306        //FIX ME: THIS VALUE IS NOT EXISTANT IN EVERY MC FILE
     307
     308        if (mVerbosityLvl > 1) cout << "   ...IncidentAngle" << endl;
     309        mpEventTree->SetBranchAddress("IncidentAngle.",     &mpIncidentAngle);
     310    }
     311    if ( mpEventTree->GetBranchStatus("MMcEvt.") )
     312    {
     313        if (mVerbosityLvl > 1) cout << "   ...McEvt" << endl;
     314        mpEventTree->SetBranchAddress("MMcEvt.",            &mpMcEventMetaData);
     315    }
     316    if ( mpEventTree->GetBranchStatus("MRawEvtHeader.") )
     317    {
     318        if (mVerbosityLvl > 1) cout << "   ...MRawEventHeader" << endl;
     319        mpEventTree->SetBranchAddress("MRawEvtHeader.",     &mpRawEventHeader);
     320    }
     321    if ( mpEventTree->GetBranchStatus("MCorsikaEvtHeader.") )
     322    {
     323        if (mVerbosityLvl > 1) cout << "   ...MCorsikaEvtHeader" << endl;
     324        mpEventTree->SetBranchAddress("MCorsikaEvtHeader.", &mpCorsikaEvtHeader);
     325    }
    274326
    275327    return;
Note: See TracChangeset for help on using the changeset viewer.