Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
228d1e6
fix all the tabbing issues in Settings class to prepare for adding ne…
clark2668 Dec 12, 2019
65af138
fix yet more tabbing issues
clark2668 Dec 12, 2019
eca394b
add DETECTOR_STATION_LIVETIME_CONFIG to settings class in preparation…
clark2668 Dec 12, 2019
e953206
fix tabs in report to prepare for adding delay variables
clark2668 Dec 12, 2019
386634d
add triggerDelay and mostDelay variables to Report, but do not use th…
clark2668 Dec 12, 2019
8afb844
slight reordering of parameters in addition, and, add offset to same …
clark2668 Dec 12, 2019
c2dd141
add masked trigger channel skipping for relevant config
clark2668 Dec 12, 2019
9f6beec
add ability to mask relevant channels in specifica A2 configs
clark2668 Dec 12, 2019
cbc32c4
Implement Settings::USE_SIGNAL_CHAIN_LOWER_BOUND,
Dec 19, 2019
85119a2
Implement the low-pass filter and the SC efficiency errors for
Dec 19, 2019
2bd6368
Added low-pass filter file
Dec 19, 2019
4055912
Update log.txt
Dec 19, 2019
904c0b1
Comment out unnecessary cout's
Dec 19, 2019
bf3c72d
Check USE_SIGNAL_CHAIN_LOWER_BOUND against DETECTOR!=4 and TestBed
Dec 19, 2019
4971901
Merge pull request #6 from mingyuanlu/a23_4yr_diffuse
mingyuanlu Dec 20, 2019
9dd5069
Adding files for fig. 23 of TB paper: Attenuation lenght models, uppe…
Jan 13, 2020
616f257
Added lower and upper bounds for the attenuation length model in ice
Jan 14, 2020
0af9a1f
gitignore
Jan 14, 2020
68690c9
Fix
Jan 14, 2020
b90929b
Added upper/lower bounds for ice attenuation model
Jan 14, 2020
8ac9f3f
Finished adding upper and lower uncertainties for the attenuation len…
Jan 14, 2020
382b1e6
Added a check in the settings file so that SYSTEMATICS_IceAtten=1,2 i…
Jan 15, 2020
8308dab
Merge branch 'hotfix-7' into a23_4yr_diffuse
Jan 15, 2020
c56aa9f
Merge pull request #10 from mingyuanlu/a23_4yr_diffuse
mingyuanlu Jan 15, 2020
cb89900
Seems that I didn't commit log.txt
Jan 16, 2020
07cf7c7
Merge branch 'a23_4yr_diffuse' of https://github.com/ara-software/Ara…
Jan 16, 2020
a84f187
Added SYSTEMATICS_Askaryan in settings, to evaluate Askaryan model sy…
Jan 23, 2020
39301a9
Initialize Settings::DETECTOR_STATION & Settings
Jan 24, 2020
bc37d44
Fixed typo in Settings.cc
Jan 26, 2020
8a532fe
Fixed Askaryan and made some changes for Latten in the IceModel class
Jan 26, 2020
d90eec9
Fixed IceModel class
Jan 27, 2020
4f32792
add SYSTEMATICS_nofz support
clark2668 Jan 27, 2020
ce4679f
reduce output verbosity
clark2668 Jan 27, 2020
452618a
Merge branch 'a23_4yr_diffuse' into a23_4yr_diffuse
Jan 27, 2020
dedaef2
Merge pull request #15 from mingyuanlu/a23_4yr_diffuse
mingyuanlu Jan 27, 2020
8dcdc36
Changed name of nofz systematics parameter in nofz, as it was wrong
Jan 28, 2020
188db22
Fixed Icemodel class. Arrays need to be defined when initializing the…
Jan 28, 2020
5aa5b08
Fixed Icemodel class. Arrays need to be defined when initializing the…
Jan 28, 2020
f582295
Changed atof to atoi when reading parameters from settings
Jan 28, 2020
306c703
Fixed Icemodel class. Arrays need to be defined when initializing the…
Jan 28, 2020
c5c398b
Fixed Icemodel class. Missing int
Jan 28, 2020
8f6df82
Fixed the IceModel class so it correctly passes the Latten systematic…
Jan 29, 2020
6942595
Reduce verbosity
Jan 29, 2020
c15d0ea
fix some tabbing, and more elegantly copy attenuation length and dept…
clark2668 Jan 29, 2020
4710305
add a little explanatory note
clark2668 Jan 29, 2020
0a849ce
reduce verbosity on atteunation systematic loading
clark2668 Jan 29, 2020
5f2602a
make icemodel systematics filling c++11 friendly by not relying on ar…
clark2668 Feb 5, 2020
a8a4099
reduce the verbosity of frequency, gain, phase, etc data in detector.cc
clark2668 Feb 7, 2020
f542ca3
Added flux from arXiv:0712.1830 (Cuoco et. al)
Mar 5, 2020
90cd0c3
Fixed IceModel to switch names between upper and lower bounds
Mar 5, 2020
cca8933
test
Mar 5, 2020
f14b1e8
rm test
Mar 5, 2020
725b848
add cooper-sarkar uncertainties to available cross-section models
clark2668 Mar 15, 2020
0e0cd5c
add ability to use cooper-sarkar uncertainties on the connolly cross …
clark2668 Mar 15, 2020
48b8831
fix typo in log file
clark2668 Mar 15, 2020
8c50f3d
fix mistake where Cooper-Sarkar uncertainties applied to CTW cross se…
clark2668 Mar 16, 2020
d5788f4
mainly fix an error in the uncertainties for 1E21 in cooper sarkar nu…
clark2668 Mar 18, 2020
db84014
Adding flux by Cuoco et al
Apr 6, 2020
d697712
Adding Cuoco et al flux
Jun 9, 2020
77e9778
Fixed fluxes/Cuoco_CenA.dat with correct formatting
Jun 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
829 changes: 829 additions & 0 deletions #AraSim.cc#

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
eventSimDict.C
eventSimDict.h
AraSim
*.ipynb
94 changes: 47 additions & 47 deletions AraSim.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ROOT includes
#include "TFile.h"
#include "TRandom3.h"
#include "TRandom3.h"
#include "TTree.h"

// AraSim includes
Expand Down Expand Up @@ -42,7 +42,7 @@ void test();
string outputdir="outputs";

int main(int argc, char **argv) { // read setup.txt file

Settings *settings1 = new Settings();

cout<<"\n\tDefault values!"<<endl;
Expand Down Expand Up @@ -88,7 +88,7 @@ int main(int argc, char **argv) { // read setup.txt file
cerr<<"There are "<< settings_compatibility_error<<" errors from settings. Check error messages."<<endl;
return -1;
}

cout<<"\n\tNew values!"<<endl;
cout<<"NNU : "<<settings1->NNU<<endl;
cout<<"ICE_MODEL : "<<settings1->ICE_MODEL<<endl;
Expand Down Expand Up @@ -119,35 +119,35 @@ int main(int argc, char **argv) { // read setup.txt file
gRandom = test_randm3;
} else {
gRandom->SetSeed(settings1->SEED + atoi(run_no.c_str() ) );

}
//cout<<"first random from TRandom3 : "<<test_randm3->Rndm()<<"\n";
cout<<"first random : "<<gRandom->Rndm()<<"\n";

// IceModel *icemodel=new IceModel(ICE_MODEL + NOFZ*10,CONSTANTICETHICKNESS * 1000 + CONSTANTCRUST * 100 + FIXEDELEVATION * 10 + 0,MOOREBAY);// creates Antarctica ice model
IceModel *icemodel=new IceModel(settings1->ICE_MODEL + settings1->NOFZ*10,settings1->CONSTANTICETHICKNESS * 1000 + settings1->CONSTANTCRUST * 100 + settings1->FIXEDELEVATION * 10 + 0,settings1->MOOREBAY);// creates Antarctica ice model
// IceModel inherits from EarthModel
IceModel *icemodel=new IceModel(settings1->ICE_MODEL + settings1->NOFZ*10,settings1->CONSTANTICETHICKNESS * 1000 + settings1->CONSTANTCRUST * 100 + settings1->FIXEDELEVATION * 10 + 0,settings1->MOOREBAY, settings1->SYSTEMATICS_IceAtten);// creates Antarctica ice model
// IceModel inherits from EarthModel

cout<<endl;
cout<<"Surface at (log:0, lat:0) : "<<icemodel->Surface(0., 0.)<<endl;
cout<<"SurfaceAboveGeoid at (log:0, lat:0) : "<<icemodel->SurfaceAboveGeoid(0., 0.)<<endl;

// Detector *detector=new Detector(settings1, icemodel); // builds antenna array, 0 for testbed
Detector *detector=new Detector(settings1, icemodel, setupfile ); // builds antenna array, 0 for testbed
cout<<"end calling detector"<<endl;
// Detector *detector=new Detector(settings1->DETECTOR); // builds antenna array, 0 for testbed

Trigger *trigger=new Trigger(detector, settings1); // builds the trigger
Trigger *trigger=new Trigger(detector, settings1); // builds the trigger
// Efficiencies *efficiencies=new Efficiencies(detector->getnRx(),outputdir); // keeps track of efficiencies at each stage of the simulation
Efficiencies *efficiencies=new Efficiencies(100,outputdir); // keeps track of efficiencies at each stage of the simulation
cout<<"called Efficiencies"<<endl;

Spectra *spectra=new Spectra(settings1->EXPONENT); // gets library (or whatever) of neutrino spectra
cout<<"called Spectra"<<endl;

Ray *ray = new Ray(); // construct Ray class
cout<<"called Ray"<<endl;


// test PickUnbiased in IceModel.
Counting *count1 = new Counting();
Expand All @@ -160,7 +160,7 @@ int main(int argc, char **argv) { // read setup.txt file
//--------------------------------------------------
// Interaction *interaction1=new Interaction("nu",primary1,settings1,whichray,count1);
// cout<<"called Interaction1"<<endl;
//--------------------------------------------------
//--------------------------------------------------

Event *event = new Event();
cout<<"called Event"<<endl;
Expand Down Expand Up @@ -207,7 +207,7 @@ int main(int argc, char **argv) { // read setup.txt file
#ifdef ARA_UTIL_EXISTS
UsefulIcrrStationEvent *theIcrrEvent =0;
UsefulAtriStationEvent *theAtriEvent =0;


TTree *eventTree;

Expand Down Expand Up @@ -265,7 +265,7 @@ int main(int argc, char **argv) { // read setup.txt file

double max_dt = 0.; // max arrival time difference

int Total_Global_Pass = 0; // total global trigger passed number
int Total_Global_Pass = 0; // total global trigger passed number
double Total_Weight = 0.;
double Total_Probability = 0.;

Expand Down Expand Up @@ -311,13 +311,13 @@ int main(int argc, char **argv) { // read setup.txt file

ofstream TrigWind;
TrigWind.open("outputs/TrigWindowStudy.txt");


// for (int iTrigWind = 10; iTrigWind < 201; iTrigWind = iTrigWind+10){

// double TRIG_WINDOW_Size = double (iTrigWind * 1.0E-9);
// settings1->TRIG_WINDOW = TRIG_WINDOW_Size;

Total_Global_Pass = 0;
cout<<"begin looping events!!"<<endl;

Expand Down Expand Up @@ -348,15 +348,15 @@ int main(int argc, char **argv) { // read setup.txt file




// check if settings have to compatibility problems
// if there's any, stop AraSim
settings_compatibility_error = settings1->CheckCompatibilitiesDetector(detector);
if (settings_compatibility_error > 0) {
cerr<<"There are "<< settings_compatibility_error<<" errors from settings after Detector class instance is initialized. Check error messages."<<endl;
return -1;
}

#ifndef ARA_UTIL_EXISTS
if (settings1->DETECTOR == 3 && settings1->READGEOM == 1){
cerr << "ERROR::InstalledStation geometry not available without AraRoot installation!" << endl;
Expand All @@ -368,7 +368,7 @@ int main(int argc, char **argv) { // read setup.txt file
// test autoflush
// AraTree2->SetAutoFlush(0);

// reset accumulative trig search bin info
// reset accumulative trig search bin info
settings1->ACCUM_TRIG_SEARCH_BINS_STATION0 = 0.;

int nuLimit =0;
Expand All @@ -381,13 +381,13 @@ int main(int argc, char **argv) { // read setup.txt file
else {
nuLimit = settings1->NNU;
}
// cout << "nuLimit: " << nuLimit << endl;
// cout << "nuLimit: " << nuLimit << endl;
int inu = 0;
int Events_Thrown = 0;
int Events_Passed = 0;
// for (int inu=0;inu<settings1->NNU;inu++) { // loop over neutrinos
while (inu < nuLimit){
// cout << "inu: " << inu << endl;
// cout << "inu: " << inu << endl;
check_station_DC = 0;
check_station_DC = 0;
if ( settings1->DEBUG_MODE_ON==0 ) {
Expand All @@ -399,9 +399,9 @@ int main(int argc, char **argv) { // read setup.txt file
// event = new Event ( settings1, spectra, primary1, icemodel, detector, signal, sec1 );
event = new Event ( settings1, spectra, primary1, icemodel, detector, signal, sec1, Events_Thrown );
event->inu_passed = -1;

report = new Report(detector, settings1);

#ifdef ARA_UTIL_EXISTS
theIcrrEvent = new UsefulIcrrStationEvent();
theAtriEvent = new UsefulAtriStationEvent();
Expand Down Expand Up @@ -429,7 +429,7 @@ int main(int argc, char **argv) { // read setup.txt file
// cout<<"nu_flavor : "<<event->nuflavor<<endl;
// cout<<"event->Nu_Interaction[0].vmmhz1m[0] : "<<event->Nu_Interaction[0].vmmhz1m[0]<<endl;
// cout<<"pickposnu : "<<event->Nu_Interaction[0].pickposnu<<endl;
//--------------------------------------------------
//--------------------------------------------------

// connect Interaction class (nu interaction with ice) and Detector class (detector properties and layout)
// save signal, noise at each antennas to Report class
Expand Down Expand Up @@ -466,9 +466,9 @@ int main(int argc, char **argv) { // read setup.txt file
}
weight = event->Nu_Interaction[0].weight;
}
// cout << "weight: " << weight <<endl;
// cout << "weight: " << weight <<endl;
#endif

report->ClearUselessfromConnect(detector, settings1, trigger);
for(int i=0;i<event->Nu_Interaction.size(); i++)
event->Nu_Interaction[i].clear_useless(settings1);
Expand Down Expand Up @@ -496,24 +496,24 @@ int main(int argc, char **argv) { // read setup.txt file
{ theIcrrEvent->numRFChans = 14; }
else if (settings1->DETECTOR == 4 && settings1->DETECTOR_STATION == 0)
{ theIcrrEvent->numRFChans = 14; }
else {
theAtriEvent->fNumChannels = 20;
theIcrrEvent->numRFChans = 16;
else {
theAtriEvent->fNumChannels = 20;
theIcrrEvent->numRFChans = 16;
}
}
#endif

if (max_dt < report->stations[i].max_arrival_time - report->stations[i].min_arrival_time)
max_dt = report->stations[i].max_arrival_time - report->stations[i].min_arrival_time;
// check the total global trigger passed
if (report->stations[i].Global_Pass) {
cout<<"\nGlobal_Pass : "<<report->stations[i].Global_Pass<<" evt : "<<inu<<" added weight : "<<event->Nu_Interaction[0].weight<<endl;
if ( check_station_DC == 0) { // count trigger pass only once per event

Total_Global_Pass ++;
Total_Weight += event->Nu_Interaction[0].weight;
Total_Probability += event->Nu_Interaction[0].probability;

// test increment weight
if (settings1->INTERACTION_MODE==1) {
count1->incrementEventsFound( event->Nu_Interaction[0].weight, event );
Expand All @@ -526,10 +526,10 @@ int main(int argc, char **argv) { // read setup.txt file
}
else if (settings1->INTERACTION_MODE==4) {
count1->incrementEventsFound( event->Nu_Interaction[0].weight, event );
}
}
}
check_station_DC++;
event->inu_passed = Events_Passed;
event->inu_passed = Events_Passed;
}
}

Expand Down Expand Up @@ -563,7 +563,7 @@ int main(int argc, char **argv) { // read setup.txt file


// test FILL_TREE_MODE
if (settings1->FILL_TREE_MODE==0) { // fill event event
if (settings1->FILL_TREE_MODE==0) { // fill event event
AraTree2->Fill(); //fill interaction every events
#ifdef ARA_UTIL_EXISTS
// for 1, save all events whether passed trigger or not
Expand All @@ -580,7 +580,7 @@ int main(int argc, char **argv) { // read setup.txt file
}
#endif
}
else if (settings1->FILL_TREE_MODE==1) { // fill only usable posnu event
else if (settings1->FILL_TREE_MODE==1) { // fill only usable posnu event
if (event->Nu_Interaction[0].pickposnu>0) {
AraTree2->Fill(); //fill interaction every events
#ifdef ARA_UTIL_EXISTS
Expand All @@ -599,7 +599,7 @@ int main(int argc, char **argv) { // read setup.txt file
#endif
}
}
else if (settings1->FILL_TREE_MODE==2) { // fill only triggered event
else if (settings1->FILL_TREE_MODE==2) { // fill only triggered event
if (check_station_DC>0) {
AraTree2->Fill(); //fill interaction every events
#ifdef ARA_UTIL_EXISTS
Expand Down Expand Up @@ -633,7 +633,7 @@ int main(int argc, char **argv) { // read setup.txt file
Events_Passed++;
}
Events_Thrown++;


//theEvent = NULL;

Expand Down Expand Up @@ -666,10 +666,10 @@ int main(int argc, char **argv) { // read setup.txt file

// }// end trigger window loop
TrigWind.close();

//--------------------------------------------------
// cFull_window_V->Print("test_V_mimic.pdf");
//--------------------------------------------------
//--------------------------------------------------

ofstream weight_file;
//weight_file.open(("./weight_output/weight_"+setupfile).c_str());
Expand All @@ -690,7 +690,7 @@ int main(int argc, char **argv) { // read setup.txt file
cout<<"Total_Global_Pass : "<<Total_Global_Pass<<endl;
cout<<"Total_Weight : "<<Total_Weight<<endl;
cout<<"Total_Probability : "<<Total_Probability<<endl;

if (settings1->INTERACTION_MODE==1) {
weight_file << "Total_Weight="<<Total_Weight<<endl;
}
Expand Down Expand Up @@ -724,7 +724,7 @@ int main(int argc, char **argv) { // read setup.txt file
double error_minus = 0;
Counting::findErrorOnSumWeights( count1->eventsfound_binned, error_plus, error_minus );

/*
/*
Veff_test = IceVolume * 4. * PI * signal->RHOICE / signal->RHOH20 * Total_Weight / (double)(settings1->NNU);

// account all factors to error
Expand Down Expand Up @@ -776,7 +776,7 @@ int main(int argc, char **argv) { // read setup.txt file

//--------------------------------------------------
// cout<<"Total NNU : "<<settings1->NNU<<", PickUnbiased passed NNU : "<<nnu_pass<<endl;
//--------------------------------------------------
//--------------------------------------------------

// remove noisewaveform info if DATA_SAVE_MODE == 2
// remove noisewaveform info if DATA_SAVE_MODE is not 0
Expand All @@ -792,7 +792,7 @@ int main(int argc, char **argv) { // read setup.txt file
AraFile->Write();
// AraFile->Close();

efficiencies->summarize(); // summarize the results in an output file
efficiencies->summarize(); // summarize the results in an output file

double freq[detector->GetFreqBin()], Filter[detector->GetFreqBin()];
double Filter_E[detector->GetFreqBin()];
Expand Down Expand Up @@ -822,12 +822,12 @@ int main(int argc, char **argv) { // read setup.txt file
cout<<"outputdir= "<<outputdir<<endl;

// Please do not delete this test line
// Please leave 'test(); return 0;' as the last lines in
// Please leave 'test(); return 0;' as the last lines in
// AraSim.cc before '} //end main'
// These test lines are used to verify that AraSim completed properly.

test();
return 0;
return 0;
} //end main


Expand Down
Loading