Main Page   Compound List   File List   Compound Members   File Members  

ReactorFsim.cpp File Reference

ReactorFsim simulation for MWtheta13. More...

#include "ReactorFortran.hh"
#include "ReactorConstants.hh"
#include "ReactorEvent.hh"
#include "ReactorDetector.hh"
#include "ReactorXC.hh"
#include "ReactorNtuple.hh"
#include <iostream.h>
#include <math.h>
#include <string.h>

Go to the source code of this file.

Functions

int main ()
 Top level function of ReactorFsim. More...


Detailed Description

ReactorFsim simulation for MWtheta13.

ReactorFsim simulates any number of spherical, three-zone liquid scintillator neutrino detectors.

Main author: Tim Bolton

Contributing authors: Erin Abouzaid, Matthew Worcester

Definition in file ReactorFsim.cpp.


Function Documentation

int main  
 

Top level function of ReactorFsim.

First sets the number of events, initializes paw, and defines each detector. The event loop creates an event and runs it through each detector added to the loop, so that each detector "sees" the exact same event each time. Finally, paw is closed and the hbook file created.

Definition at line 26 of file ReactorFsim.cpp.

References ReactorNtuple::Fill, ReactorDetector::LightsOut, ReactorDetector::SetParam_FastNeutronOption, ReactorDetector::SetParam_R0, ReactorDetector::SetParam_R1, and ReactorDetector::SetParam_R2.

00026           {
00027 
00028   //  ReactorNeutrons Neutrons;
00029   //
00030   //  Set number of events, paw file name, and ntuple name
00031   //
00032   int nevents = 100000;
00033   double rmaxgen=225;
00034   int fast=0;
00035   char* fileName="/local/data14/reactorfsim/cf252_pmtradon_100k.ntuple";
00036   char* ntName="event data";
00037   //
00038   // init random number seed
00039   //
00040   int luxury = 2;
00041   int seed = 8796896;
00042   int k1=0;
00043   int k2=0;
00044   rluxgo_(luxury,seed,k1,k2);
00045   //
00046   // Paw setup.  
00047   //
00048   hbook_init__();
00049   //
00050   int iostat;
00051   int ntLun=99;
00052   int ntBuf=1024;
00053   char* dirName = "TEST";
00054   char* chopt = "N";
00055   hropen_(ntLun,dirName,fileName,chopt,ntBuf,iostat,
00056           strlen(dirName),strlen(fileName),strlen(chopt));
00057   //
00058   // Set up simple detector models
00059   // Set up simple Ntuple and histogranms 
00060   // See ReactorNtuple.hh for ntuple/histogram details.
00061   //
00062   ReactorDetector DetectorA;
00063   DetectorA.SetParam_FastNeutronOption(fast);
00064   DetectorA.SetParam_R0(175);
00065   DetectorA.SetParam_R1(200);
00066   DetectorA.SetParam_R2(275);
00067   ReactorNtuple ModelA(1,"model A",dirName);
00068   //
00069   // event loop
00070   //
00071   for (int events = 0;events<nevents;events++){
00072     //
00073     // create neutrino event
00074     //
00075     ReactorEvent Event(nevents,rmaxgen);
00076     //
00077     // create fast detector simulation
00078     //
00079     DetectorA.LightsOut(Event);
00080     ModelA.Fill(Event,DetectorA);
00081     //
00082   }
00083   //
00084   // close up paw
00085   //
00086   hldir_(" "," ",strlen(" "),strlen(" "));
00087   char dirName2[strlen(dirName)+2];
00088   *dirName2='\0';
00089   strcat(dirName2,"//");
00090   strcat(dirName2,dirName);
00091   hcdir_(dirName2," ",strlen(dirName2),strlen(" "));
00092   int outopt = 0;
00093   int icycle;
00094   hrout_(outopt,icycle," ",strlen(" "));
00095   hrend_(dirName,strlen(dirName));
00096 }


Generated on Thu Jul 29 14:27:04 2004 for ReactorFsim by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002