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.
File:
1 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//
Note: See TracChangeset for help on using the changeset viewer.