Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion CRVResponse/src/CrvDigitizer_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ namespace mu2e
const std::vector<double> &voltages = crvDigiMC.GetVoltages();
double startTime = crvDigiMC.GetStartTime();
double TDC0time = crvDigiMC.GetTDC0Time();
double NZS = crvDigiMC.IsNZS();
bool NZS = crvDigiMC.IsNZS();

//start time gets measured with respect to FEB's TDC near the event window start.
//that's the TDC that gets set to TDC=0 and can be anywhere within: event window start <= t < event window start + digitization period
Expand Down
2 changes: 1 addition & 1 deletion CRVResponse/src/CrvWaveformsGenerator_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ namespace mu2e
}

//collect CrvSteps and SimParticles responsible for this single waveform
std::set<art::Ptr<CrvStep> > steps; //use a set to remove dublicate steppoints
std::set<art::Ptr<CrvStep> > steps; //use a set to remove duplicate steppoints
std::map<art::Ptr<SimParticle>, int> simparticles;
for(size_t j=0; j<timesAndCharges.size(); ++j)
{
Expand Down
25 changes: 7 additions & 18 deletions CRVResponse/src/MakeCrvPhotons.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ bool LookupBinDefinitions::findScintillatorCerenkovBinReverse(unsigned int bin,
int nZBins=zBins.size()-1;
int nBetaBins=betaBins.size()-1;
xbin = (bin / (nBetaBins*nZBins*nYBins)) % nXBins;
ybin = (bin / nBetaBins*nZBins) % nYBins;
ybin = (bin / (nBetaBins*nZBins)) % nYBins;
zbin = (bin / nBetaBins) % nZBins;
betabin = bin % nBetaBins;
return true;
Expand Down Expand Up @@ -321,9 +321,6 @@ void MakeCrvPhotons::MakePhotons(const CLHEP::Hep3Vector &stepStartTmp, //they
stepEnd[3].setZ(-stepEnd[3].z());
stepEnd[3].setY(-stepEnd[3].y());

static int nPScintillation=0;
static int nPCerenkov=0;

for(int SiPM=0; SiPM<_nSiPMs; SiPM++)
{
//there are only lookup tables without reflector or with reflector on the +z side (i.e. at SiPMs #1 and #3)
Expand Down Expand Up @@ -387,9 +384,6 @@ static int nPCerenkov=0;
}
}

nPScintillation+=nPhotonsScintillation;
nPCerenkov+=nPhotonsCerenkov;

//loop over all photons created at this point
int nPhotons = nPhotonsScintillation + nPhotonsCerenkov;
for(int i=0; i<nPhotons; i++)
Expand Down Expand Up @@ -418,11 +412,9 @@ nPCerenkov+=nPhotonsCerenkov;
else _arrivalTimes[SiPM+1].push_back(arrivalTime);

}// if a photon was created
}//loop over all SiPMs
}//loop over all photons at this point
}//loop over all points along the track

//std::cout<<"Lookup tables: total scintillation: "<<nPScintillation<<" total Cerenkov: "<<nPCerenkov<<std::endl;
}//loop over all photons at this point
}//loop over all steps along the track
}//loop over all SiPMs

}

Expand Down Expand Up @@ -559,12 +551,9 @@ double MakeCrvPhotons::GetAverageNumberOfCerenkovPhotons(double beta, double cha
numberPhotons*=fabs(charge/eplus);
return numberPhotons;
}
if(first)
{
prevBeta=i->first;
prevNumberPhotons=i->second;
first=false;
}
prevBeta=i->first;
prevNumberPhotons=i->second;
first=false;
}
return photons.rbegin()->second*fabs(charge/eplus); //this shouldn't happen
}
Expand Down
8 changes: 4 additions & 4 deletions CRVResponse/src/MakeCrvSiPMCharges.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ double MakeCrvSiPMCharges::GenerateAvalanche(Pixel &pixel, const std::pair<int,i
if(_randFlat.fire() < _probabilities._trapType0Prob/_avalancheProbFullyChargedPixel)
{
//create new Type0 trap (fast)
double traptime = -_probabilities._trapType0Lifetime * log10(_randFlat.fire());
double traptime = -_probabilities._trapType0Lifetime * log(_randFlat.fire());
_scheduledCharges.emplace(pixelId,time + traptime,photonIndex,darkNoise);
}

if(_randFlat.fire() < _probabilities._trapType1Prob/_avalancheProbFullyChargedPixel)
{
//create new Type1 trap (slow)
double traptime = -_probabilities._trapType1Lifetime * log10(_randFlat.fire());
double traptime = -_probabilities._trapType1Lifetime * log(_randFlat.fire());
_scheduledCharges.emplace(pixelId,time + traptime,photonIndex,darkNoise);
}

Expand Down Expand Up @@ -207,9 +207,9 @@ MakeCrvSiPMCharges::MakeCrvSiPMCharges(CLHEP::RandFlat &randFlat, CLHEP::RandPoi
_randFlat(randFlat), _randPoissonQ(randPoissonQ), _avalancheProbFullyChargedPixel(0)
{
_photonMapFile = new TFile(photonMapFileName.c_str());
if(_photonMapFile==NULL) throw std::logic_error("Could not open photon map file.");
if(!_photonMapFile || _photonMapFile->IsZombie()) throw std::logic_error("Could not open photon map file.");
_photonMap = (TH2F*)_photonMapFile->FindObjectAny("photonMap");
if(_photonMap==NULL) throw std::logic_error("Could not find photon map.");
if(!_photonMap) throw std::logic_error("Could not find photon map.");
}

}
Expand Down