Changeset 6560


Ignore:
Timestamp:
02/17/05 09:15:28 (20 years ago)
Author:
moralejo
Message:
Set as default option that of writing all event headers to output file,
not only those of the triggered events. To disable it, set the input card
flag "no_write_all_event_headers".

Changed such that output images for events below the minimum number of
photoelectrons nphe2NSB required to simulate the noise (NSB & electronic)
will be empty. This will avoid the problem of these events being processed,
without any noise, later in the chain. Although those images are not in the
output, one can still check in the headers (MMcTrig) how many such events
with less than nphe2NSB photoelectrons would have triggered.
Location:
trunk/MagicSoft/Simulation/Detector/Camera
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx

    r6386 r6560  
    141141//@: flag: TRUE: write the event headers of all events to output;
    142142//@:       FALSE: only triggered showers
    143 static int Write_All_Event_Headers = FALSE;
     143static int Write_All_Event_Headers = TRUE;
    144144
    145145static int Write_McEvt  = TRUE;
     
    20112011                            fadc_jitter[ict]);
    20122012
    2013           inumphe=(inumphe<inumphe_CT[ict])?inumphe_CT[ict]:inumphe;
     2013          inumphe = (inumphe < inumphe_CT[ict])? inumphe_CT[ict] : inumphe;
     2014          // inumphe will be the maximum number of phe in any of the telescopes
     2015
    20142016
    20152017          if( k != 0 ){ // non-zero return value means error
     
    20212023        // NSB simulation
    20222024
    2023         if(simulateNSB && nphe2NSB<=inumphe)
     2025        if(simulateNSB && inumphe >= nphe2NSB)
    20242026          {
    20252027
     
    20832085            }
    20842086         
    2085           }// end if(simulateNSB && nphe2NSB<=inumphe_CT[0]) ...
     2087          }// end if(simulateNSB && inumphe_CT[0] >= nphe2NSB) ...
    20862088
    20872089
     
    21512153        for(int ict=0;ict<ct_Number;ict++)
    21522154          {
    2153             if (addElecNoise && nphe2NSB<=inumphe)
     2155            if (addElecNoise && inumphe >= nphe2NSB)
    21542156              {
    2155                 Trigger_CT[ict]->ElecNoise(Trigger_noise) ;
    2156                 Fadc_CT[ict]->ElecNoise() ;
     2157                Trigger_CT[ict]->ElecNoise(Trigger_noise);
     2158                Fadc_CT[ict]->ElecNoise();
    21572159              }
    21582160          }
     
    21872189                    // Rise the discrimnator threshold to avoid huge rates
    21882190
    2189                     if(riseDiskThres>0.0 && simulateNSB && nphe2NSB<=inumphe)
     2191                    if(riseDiskThres>0.0 && simulateNSB && inumphe >= nphe2NSB)
    21902192                      for(int ii=0;ii<ct_NPixels;ii++)
    21912193                        if( nsb_phepns_rotated[0][ii]>riseDiskThres)
     
    24712473
    24722474              // Rise the discrimnator threshold to avoid huge rates
    2473               if(riseDiskThres>0.0 && simulateNSB && nphe2NSB<=inumphe)
     2475              if(riseDiskThres>0.0 && simulateNSB && inumphe >= nphe2NSB)
    24742476                for(int ii=0;ii<ct_NPixels;ii++)
    24752477                  {
     
    25642566                EvtHeader[ict]->SetTriggerPattern((UInt_t)MTriggerPattern::kTriggerLvl1);
    25652567
    2566                 //   fill pixel information
    2567              
    2568                 if (Lev1MT[ict] /* || Write_All_Event_Headers */){
    2569                    if (addElecNoise) Fadc_CT[ict]->DigitalNoise();
    2570                   for(UInt_t i=0;
    2571                       i<((MGeomCam*)(camgeom.UncheckedAt(ict)))->GetNumPixels();
    2572                       i++){
     2568                // Fill pixel information
     2569                // AM 17/2/2005: added condition on inumphe. Noise is not generated for
     2570                // events with less than phe2NSB photoelectrons, and then it is better not
     2571                // to write the images of those events to the output, so that we avoid them
     2572                // to be processed (with no noise) later in the chain.
     2573               
     2574                if (Lev1MT[ict] && inumphe >= nphe2NSB)
     2575                  {
     2576                    if (addElecNoise)
     2577                      Fadc_CT[ict]->DigitalNoise();
     2578                    for(UInt_t i=0;
     2579                        i<((MGeomCam*)(camgeom.UncheckedAt(ict)))->GetNumPixels();
     2580                        i++){
    25732581//
    25742582// AM 15 01 2004 Commented out "continue" statement, so that also pixels
    25752583// containing no C-photons will be written to the output in case of running
    2576 // camera with no noise added to the signal.         
     2584// camera with no noise added to the signal.
    25772585//                  if(!Fadc_CT[ict]->IsPixelUsed(i)) continue;
    25782586//
    2579                     for (j = 0; j < FADC_slices_written; j++)
    2580                       {
    2581                         fadcValues->AddAt(Fadc_CT[ict]->GetFadcSignal(i,j),j);
    2582                         fadcValuesLow->AddAt(Fadc_CT[ict]->GetFadcLowGainSignal(i,j),j);
    2583                       }
    2584                     EvtData[ict]->AddPixel(i,fadcValues,0);
    2585                     EvtData[ict]->AddPixel(i,fadcValuesLow,kTRUE);
     2587                      for (j = 0; j < FADC_slices_written; j++)
     2588                        {
     2589                          fadcValues->AddAt(Fadc_CT[ict]->GetFadcSignal(i,j),j);
     2590                          fadcValuesLow->AddAt(Fadc_CT[ict]->GetFadcLowGainSignal(i,j),j);
     2591                        }
     2592                      EvtData[ict]->AddPixel(i,fadcValues,0);
     2593                      EvtData[ict]->AddPixel(i,fadcValuesLow,kTRUE);
     2594                    }
    25862595                  }
    2587                 }
    25882596              }
    25892597            }
     
    50235031//
    50245032// $Log: not supported by cvs2svn $
     5033// Revision 1.88  2005/02/11 20:00:01  moralejo
     5034//
     5035// Added to output container "MMcEvtBasic" with the most important MC
     5036// parameters, to be kept for all events (triggered or not) through
     5037// the whole analysis chain in order to allow the calculation of effective
     5038// areas.
     5039//
     5040// Updated version of MRawRunHeader from 4 to 5. This means the trigger and
     5041// calibration patterns are correctly set and can be decoded.
     5042//
    50255043// Revision 1.87  2005/02/10 19:28:10  moralejo
    50265044//
  • trunk/MagicSoft/Simulation/Detector/Camera/creadparam.cxx

    r6365 r6560  
    1919//=
    2020//= $RCSfile: creadparam.cxx,v $
    21 //= $Revision: 1.36 $
     21//= $Revision: 1.37 $
    2222//= $Author: moralejo $
    23 //= $Date: 2005-02-10 19:28:10 $
     23//= $Date: 2005-02-17 09:15:28 $
    2424//=
    2525//=//////////////////////////////////////////////////////////////////////
     
    6262static int nSkip=0;
    6363static int Data_From_STDIN = FALSE;
    64 static int Write_All_Event_Headers = FALSE;
     64static int Write_All_Event_Headers = TRUE;
    6565static int Write_McEvt  = TRUE;
    6666static int Write_McTrig = FALSE;
     
    424424      break;
    425425
    426     case write_all_event_headers:  //@< to write ALL the event headers
     426    case no_write_all_event_headers:  //@< to write ALL the event headers
    427427         
    428428      // change boolean value
    429       Write_All_Event_Headers = TRUE;
     429      Write_All_Event_Headers = FALSE;
    430430
    431431      break;
     
    14451445//
    14461446// $Log: not supported by cvs2svn $
     1447// Revision 1.36  2005/02/10 19:28:10  moralejo
     1448//
     1449// Substituted input card option "write_all_events" by
     1450// "write_all_event_headers". If set, this will make camera to write out
     1451// the event headers of all the processed events, no matter whether they
     1452// have triggered or not.
     1453//
    14471454// Revision 1.35  2004/12/15 01:56:39  MAGIC
    14481455//
  • trunk/MagicSoft/Simulation/Detector/Camera/creadparam.h

    r6365 r6560  
    1919//=
    2020//= $RCSfile: creadparam.h,v $
    21 //= $Revision: 1.32 $
     21//= $Revision: 1.33 $
    2222//= $Author: moralejo $
    23 //= $Date: 2005-02-10 19:28:10 $
     23//= $Date: 2005-02-17 09:15:28 $
    2424//=
    2525//=//////////////////////////////////////////////////////////////////////
     
    9191T(data_from_stdin), /* to read data from STDIN */ \
    9292T(skip),            /* skip pathological showers */ \
    93 T(write_all_event_headers),/* write to file .phe ALL event headers (even w.o. trigger)*/ \
     93T(no_write_all_event_headers),/* do NOT write to output file all event
     94                                 event headers (only those with trigger!)*/ \
    9495T(nowrite_McEvt),   /* nowrite to file .root McEvt infos */ \
    9596T(write_McTrig),    /* write to file .root McTrig infos */ \
     
    216217/*
    217218 * $Log: not supported by cvs2svn $
     219 * Revision 1.32  2005/02/10 19:28:10  moralejo
     220 *
     221 * Substituted input card option "write_all_events" by
     222 * "write_all_event_headers". If set, this will make camera to write out
     223 * the event headers of all the processed events, no matter whether they
     224 * have triggered or not.
     225 *
    218226 * Revision 1.31  2004/12/15 01:56:39  MAGIC
    219227 *
Note: See TracChangeset for help on using the changeset viewer.