683{
686
687 typedef long long int counter_type;
688
692 counter_type numberOfEvents;
693 double QE;
700
701 try {
702
703 JParser<> zap(
"Example program to calculate multiples rate.");
704
717
719 }
720 catch(const exception &error) {
722 }
723
725
727
728
729 const int id = 1;
730 const JModule module = getModule<JKM3NeT_t>(id);
731
733
735
736 const double R_m = 17.0 * 2.54 * 0.5e-2;
737 const double A = PI *
R_m *
R_m;
738
739 const double wmin = 280.0;
740 const double wmax = 700.0;
742
744
746
748
749 case +2:
enigma =
new JEnigma<+2>(
D_m);
break;
750 case 0:
enigma =
new JEnigma< 0>(
D_m);
break;
751 case -2:
enigma =
new JEnigma<-2>(
D_m);
break;
752
754 }
755
756 const double vmin = 1.0 / wmax;
757 const double vmax = 1.0 / wmin;
758
760
761 for (double w = wmin; w <= wmax; w += 1.0) {
764 }
765 }
766
770
772
774
776
777 TH1D pmt(
"pmt",
NULL, 1000, -1.0, +1.0);
778
779 for (
Int_t i = 1; i != pmt.GetNbinsX(); ++i) {
780
781 const double dot = pmt.GetBinCenter(i);
782
784
786
787 case 1:
789 break;
790
791 case 3:
793 break;
794 }
795
796 pmt.SetBinContent(i, y);
797 }
798
799
802
803
806
808
811 }
812
814
815 const double D =
result.D;
816 const double V =
result.V;
817
818
819
820
821 double W = A / (4*PI*(D-
R_m)*(D-
R_m));
822
823 if (W > 0.5) {
824 W = 0.5;
825 }
826
827
830
835
837
838
839
840
841 if (N >= 2) {
842
843
844
845 const double ct =
gRandom->Uniform(-1.0, +1.0);
846 const double phi =
gRandom->Uniform(-PI, +PI);
847
848 const double st = sqrt((1.0 - ct) * (1.0 + ct));
849
852 D * ct);
853
854 buffer.clear();
855
856 for (int i = 0; i != N; ++i) {
857
858
859
861 const double w = 1.0 / v;
862
864
865 double P = 0.0;
866
867 for (size_t pmt = 0; pmt != module.size(); ++pmt) {
868
870
872
873 const double d = pos.getLength();
874
875 pos /= d;
876
878 ERROR(
"Distance " << d <<
" < " << D <<
endl);
879 }
880
882
884
885 double p = 0.0;
886
888
889 case 1:
891 break;
892
893 case 2:
895 break;
896
897 case 3:
899 break;
900 }
901
902 P +=
pi[pmt] = U * p *
exp(-d/l_abs);
903 }
904
905 if (P > W) {
906 ERROR(
"Probability " << P <<
" > " << W <<
endl);
907 }
908
910
911 int pmt = 0;
913
915
916 buffer.push_back(pmt);
917 }
918 }
919
920 if (!buffer.empty()) {
921
922 int M = buffer.size();
923
925
926 sort(buffer.begin(), buffer.end());
927
929 }
930
933
934 for (
int i = 2; i <=
M; ++i) {
935 P2[i].put((
double) (buffer.size() -
M) / (
double)
M, V);
936 }
937
938 }
939 }
940 }
942
943 for (JManager_t::iterator i =
H1.begin(); i !=
H1.end(); ++i) {
944 i->second->Scale(
bequerel / (
double) numberOfEvents);
945 }
946
947 for (
size_t M = 2;
M != 7; ++
M) {
948 cout <<
"Rate[" <<
M <<
"] = "
950 << " +/- "
953 }
954
955 for (
size_t M = 2;
M != 7; ++
M) {
957 cout <<
"P2[" <<
M <<
"] = " <<
P2[
M].getMean() <<
endl;
958 }
959 }
960
962
964
965 out.Write();
966 out.Close();
967}
double getAngularAcceptance(const double x)
Angular acceptence of PMT.
double getAbsorptionLength(const double lambda)
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for a composite optical module.
Data structure for position in three dimensions.
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
double getPhotocathodeArea()
Get photo-cathode area of PMT.
JDirection3D getDirection(const Vec &dir)
Get direction.
JPosition3D getPosition(const Vec &pos)
Get position.
double getQE(const double R, const double mu)
Get QE for given ratio of hit probabilities and expectation value of the number of photo-electrons.
size_t getCount(const array_type< T > &buffer, const JCompare_t &compare)
Count number of unique values.
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static const JPhotocathodeArea2D getPhotocathodeArea2D
Function object for effective photo-cathode area of PMT.
Auxiliary data structure for floating point format specification.
Description of Monte Carlo event generation applications.