Message: Re: The confused of Cherenkov photons Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Re: The confused of Cherenkov photons 

Forum: Particles
Re: None The confused of Cherenkov photons (yanxin0221)
Re: Feedback Re: The confused of Cherenkov photons (Gumplinger Peter)
Re: None Re: The confused of Cherenkov photons (yanxin0221)
Re: Disagree Re: The confused of Cherenkov photons (Gumplinger Peter)
Date: 16 Sep, 2013
From: yanxin0221 <yanxin0221>

Hi Peter
   Thanks a lot for your suggestion.I have solved the  reflected Cherenkov photons according to your suggestion.But The new problem is that the light spectrum is wrong.Can you help me find errors in my code.

#include "EADetectorConstruction.hh"

#include "G4Material.hh"
#include "G4Element.hh"
#include "G4LogicalBorderSurface.hh"
#include "G4LogicalSkinSurface.hh"
#include "G4OpticalSurface.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4ThreeVector.hh"
#include "G4PVPlacement.hh"
#include "G4SystemOfUnits.hh"
#include "G4Tubs.hh"

#include "G4Orb.hh"
#include "G4PVReplica.hh"
#include "G4SolidStore.hh"
#include "G4NistManager.hh"
#include "globals.hh"

#include "G4VisAttributes.hh"
#include "G4Colour.hh"

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

EADetectorConstruction::EADetectorConstruction()
 :  expHall_log(0), diamondTank_log(0),
    expHall_phys(0) ,diamondTank_phys(0)
{
   for(int j=0;j<85;j++)
     { tubedetectorl[j] =0;
       tubedetectorp[j] =0;
      }
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

EADetectorConstruction::~EADetectorConstruction(){;}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

G4VPhysicalVolume* EADetectorConstruction::Construct() {

// ------------- Materials -------------

  G4double a, z, density;
  G4int nelements;
  G4double expHall_x = 300.0*mm;
  G4double expHall_y = 300.0*mm;
  G4double expHall_z = 60.0*mm;
  G4double tank_x  =  250.0*mm;
  G4double tank_y  =  250.0*mm;
  G4double tank_z  =  50.0*mm;
// Air
// 
  G4Element* N = new G4Element("Nitrogen", "N", z=7 , a=14.01*g/mole);
  G4Element* O = new G4Element("Oxygen"  , "O", z=8 , a=16.00*g/mole);

  G4Material* Air = new G4Material("Air", density=1.29*mg/cm3, nelements=2);
  Air->AddElement(N, 70.*perCent);
  Air->AddElement(O, 30.*perCent);

// diamond
//
   G4Material* diamond = 
  new G4Material("diamond", z=6., a= 12*g/mole, density= 3.52*g/cm3);
  const G4int nEntries = 32;

  G4double PhotonEnergy[nEntries] =
            { 2.034*eV, 2.068*eV, 2.103*eV, 2.139*eV,
              2.177*eV, 2.216*eV, 2.256*eV, 2.298*eV,
              2.341*eV, 2.386*eV, 2.433*eV, 2.481*eV,
              2.532*eV, 2.585*eV, 2.640*eV, 2.697*eV,
              2.757*eV, 2.820*eV, 2.885*eV, 2.954*eV,
              3.026*eV, 3.102*eV, 3.181*eV, 3.265*eV,
              3.353*eV, 3.446*eV, 3.545*eV, 3.649*eV,
              3.760*eV, 3.877*eV, 4.002*eV, 4.136*eV };
//
// diamond
//              
  G4double RefractiveIndex1[nEntries] =
            { 2.41576, 2.41689,  2.41808, 2.41933,  2.42068,
              2.4221,  2.42358, 2.42519,  2.42687, 2.42867,
              2.4306, 2.43263, 2.43484,   2.43721, 2.43974,
              2.44245, 2.44538, 2.44856, 2.45196, 2.45569,
              2.45972, 2.46414,  2.46891, 2.47419,  2.47996,
              2.48632, 2.4934,  2.45012, 2.50993,  2.51966,
              2.5306,   2.54302};

  G4double Absorption1[nEntries] =
           {200*m,  200*m,  200*m,  200*m, 200*m, 200*m,
           200*m, 200*m, 200*m, 200*m, 200*m, 200*m,
           200*m, 200*m, 200*m, 200*m, 200*m, 200*m,
           200*m, 200*m, 200*m, 200*m, 200*m, 200*m,
           200*m, 200*m, 200*m, 200*m, 200*m, 200*m,
           200*m, 200*m };

  G4double ScintilFast[nEntries] =
            { 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
              1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
              1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
              1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
              1.00, 1.00, 1.00, 1.00 };
  G4double ScintilSlow[nEntries] =
            { 0.01, 1.00, 2.00, 3.00, 4.00, 5.00, 6.00,
              7.00, 8.00, 9.00, 8.00, 7.00, 6.00, 4.00,
              3.00, 2.00, 1.00, 0.01, 1.00, 2.00, 3.00,
              4.00, 5.00, 6.00, 7.00, 8.00, 9.00, 8.00,
              7.00, 6.00, 5.00, 4.00 };

  G4MaterialPropertiesTable* myMPT1 = new G4MaterialPropertiesTable();

  myMPT1->AddProperty("RINDEX",       PhotonEnergy, RefractiveIndex1,nEntries)
        ->SetSpline(true);
  myMPT1->AddProperty("ABSLENGTH",    PhotonEnergy, Absorption1,     nEntries)
        ->SetSpline(true);
  myMPT1->AddProperty("FASTCOMPONENT",PhotonEnergy, ScintilFast,     nEntries)
        ->SetSpline(true);
  myMPT1->AddProperty("SLOWCOMPONENT",PhotonEnergy, ScintilSlow,     nEntries)
        ->SetSpline(true);

  myMPT1->AddConstProperty("SCINTILLATIONYIELD",50./MeV);
  myMPT1->AddConstProperty("RESOLUTIONSCALE",1.0);
  myMPT1->AddConstProperty("FASTTIMECONSTANT", 1.*ns);
  myMPT1->AddConstProperty("SLOWTIMECONSTANT",10.*ns);
  myMPT1->AddConstProperty("YIELDRATIO",0.8);

  diamond->SetMaterialPropertiesTable(myMPT1);

 // Air
//
  G4double RefractiveIndex2[nEntries] =
            { 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
              1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
              1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
              1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
              1.00, 1.00, 1.00, 1.00 };

  G4MaterialPropertiesTable* myMPT2 = new G4MaterialPropertiesTable();
  myMPT2->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex2, nEntries);

  Air->SetMaterialPropertiesTable(myMPT2);

// // ------------- Volumes --------------

// The experimental Hall
//
  G4Box* expHall_box = new G4Box("World",expHall_x,expHall_y,expHall_z);
expHall_log = new G4LogicalVolume(expHall_box,Air,"World",0,0,0);

expHall_phys = new G4PVPlacement(0,G4ThreeVector(),expHall_log,"World",0,false,0);

// The diamond Tank
//        
  G4Box* diamondTank_box = new G4Box("Tank",tank_x,tank_y,tank_z);

diamondTank_log = new G4LogicalVolume(diamondTank_box,diamond,"Tank",0,0,0);

  diamondTank_phys = new G4PVPlacement(0,G4ThreeVector(),diamondTank_log,"Tank",
                        expHall_log,false,0);
G4double x;
G4double y;
G4int i;
for(int j=0;j<85;j++)
{

 i=j+1;
 x=tan(j*3.1415926/180)*40;
 y=tan(i*3.1415926/180)*40;

//G4cout << "x="<<x<<"\t" <<"y="<< y <<"\t"<<G4endl;
G4Tubs* tracker_tube = new G4Tubs("tracker_tube",x*mm,
                                   y*mm,50*nm,
                                    0.*deg,360.*deg);

tubedetectorl[j] = new G4LogicalVolume(tracker_tube,Air,"tubedetectorl",0,0,0);
tubedetectorp[j] = new G4PVPlacement(0,
            G4ThreeVector(0,0,40*mm),
             tubedetectorl[j],"tubeDetector",diamondTank_log,false,0);

 G4VisAttributes*  tubedetectorlVisAtt
    = new  G4VisAttributes(G4Colour(1.0,1.0,1.0));

 tubedetectorl[j] ->SetVisAttributes(tubedetectorlVisAtt);

  G4VisAttributes* expHall_logVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
  expHall_log ->SetVisAttributes(expHall_logVisAtt); 
  G4VisAttributes* diamondTank_logVisAtt= new G4VisAttributes(G4Colour(1.0,0.0,1.0));
  diamondTank_log ->SetVisAttributes(diamondTank_logVisAtt); 

// ------------- Surfaces --------------
//
// diamond Tank
//
  G4OpticalSurface* OpdiamondSurface = new G4OpticalSurface("diamondSurface");
  new G4LogicalBorderSurface("diamondSurface",
                                 diamondTank_phys,expHall_phys,OpdiamondSurface);

  OpdiamondSurface->SetType(dielectric_metal);
  OpdiamondSurface->SetFinish(polished);
  OpdiamondSurface->SetModel(glisur);

// Air Bubble
//
  G4OpticalSurface* OpAirSurface = new G4OpticalSurface("AirSurface");
  G4LogicalSkinSurface* AirSurface = 
          new G4LogicalSkinSurface("AirSurface", tubedetectorl[j], OpAirSurface);

  OpAirSurface->SetType(dielectric_metal);
  OpAirSurface->SetFinish(polished);
  OpAirSurface->SetModel(glisur);

  G4OpticalSurface* opticalSurface = dynamic_cast <G4OpticalSurface*>
        (AirSurface->GetSurface(tubedetectorl[j])->GetSurfaceProperty());

  if (opticalSurface) opticalSurface->DumpInfo();
//
// Generate & Add Material Properties Table attached to the optical surfaces
//
  const G4int num = 2;
  G4double Ephoton[num] = {2.034*eV, 4.136*eV};

  //OpticaldiamondSurface 
  G4double Reflectivity[num] = {0.0, 0.0};
  G4double Efficiency[num]    = {1., 1.};
  G4MaterialPropertiesTable* myST1 = new G4MaterialPropertiesTable();

  myST1->AddProperty("REFLECTIVITY", Ephoton, Reflectivity, num);
  myST1->AddProperty("EFFICIENCY",   Ephoton, Efficiency,    num);
  OpdiamondSurface->SetMaterialPropertiesTable(myST1);

  G4MaterialPropertiesTable *myST2 = new G4MaterialPropertiesTable();

  myST2->AddProperty("REFLECTIVITY", Ephoton, Reflectivity, num);
  myST2->AddProperty("EFFICIENCY",   Ephoton, Efficiency,   num);
  OpAirSurface->SetMaterialPropertiesTable(myST2);
};
//always return the physical World
  return expHall_phys;
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... The SteppingAction.cc

#include "EASteppingAction.hh"
#include "G4SteppingManager.hh"
#include "G4Step.hh"
#include "EARunAction.hh"
#include "EADetectorConstruction.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleTypes.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
EASteppingAction::EASteppingAction(EARunAction* tRun,EADetectorConstruction* tDetector)
{ 
  theRun=tRun;
  theDetector=tDetector;  
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void EASteppingAction::UserSteppingAction(const G4Step* astep)
{ 
G4double cc;
G4int dd;
G4VPhysicalVolume* volume1 = astep->GetPreStepPoint()->GetTouchableHandle()->GetVolume();
G4VPhysicalVolume* volume2 = astep->GetPostStepPoint()->GetTouchableHandle()->GetVolume();

if(volume1== (theDetector->diamondTank_phys))
if((astep->GetTrack()->GetDefinition())==(G4OpticalPhoton::OpticalPhotonDefinition()))
  {
    for(int j=0;j<85;j++)
      {if(volume2== (theDetector->tubedetectorp[j]))
          {if(astep->GetTrack()->GetTrackID()>0) 
             {if(astep->GetTrack()->GetParentID()==1)   
               cc=astep->GetTrack()->GetKineticEnergy();
               dd=int(cc*10000000/MeV); 
               (theRun->EnergyF[dd][j])++;
             };
           };
      };
   };
}

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Feedback: Re: The confused of Cherenkov photons   (Gumplinger Peter - 16 Sep, 2013)
 Add Message Add Message
to: "Re: The confused of Cherenkov photons"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]