Skip to Content.
Sympa Menu

opal - [Opal] Re: Discussion on Collimators

opal AT lists.psi.ch

Subject: The OPAL Discussion Forum

List archive

[Opal] Re: Discussion on Collimators


Chronological Thread 
  • From: Andreas Adelmann <andreas.adelmann AT psi.ch>
  • To: "opal AT lists.psi.ch" <Opal AT lists.psi.ch>
  • Cc: Veenendaal Jeroen <Jeroen.Veenendaal AT psi.ch>
  • Subject: [Opal] Re: Discussion on Collimators
  • Date: Fri, 2 Mar 2012 11:08:03 +0100
  • List-archive: <https://lists.web.psi.ch/pipermail/opal/>
  • List-id: The OPAL Discussion Forum <opal.lists.psi.ch>

Ok we always have to balance things such that, either we introduce many different
element variants or less elements and intelligent code to figure out what variant is 
actually used.

From physics point of view a collimator has the same meaning in a Cyclotron that in a beam line
so there is only a different coordinate system involved. In my opinion this should NOT be reflected by 
additional letters on the element as with CCollimator. This is not the right approach, you do not order CCopper
for your collimator :-) in the Cyclotron. 

In addition the code is not much more complicated, I would even argue in the opposite direction: 

if (isACyclCollimator())
  if( r1 > r_start - 10.0 && r1 < r_end + 10.0 )
    if( theta1 > theta_start - 10.0 && r1 < theta_end + 10.0 )
      {...}

} else {

  if((z > position_m) && (z <= position_m + getElementLength()))
   {...}


the predicate isACyclCollimator() can simply inferred from the used attributes on the collimator i.e.
if radius and azimuth is specified.

And at last for the user, it is maybe even more convenient if he do not have to remember/memorize all the variants.


Cheers Andreas 





Hi Andreas,

Well, This maybe not very effective.

For example, in CYCL in order to save time the collimator is not checked every step,  but for any turn when the bunch's radial and azimuth position is close to it like this:
if( r1 > r_start - 10.0 && r1 < r_end + 10.0 )
if( theta1 > theta_start - 10.0 && r1 < theta_end + 10.0 )
{...}
In compact cyclotorn, you don't know the particle will hit the collimator.


While in the T, it is check only on time on its z location (position_m) like this:
if((z > position_m) && (z <= position_m + getElementLength()))
{...}

If we merge all types of collimators in one, the different concepts comes together, this will cause confusing for both T and CYCL user, and for developer. 

Jianjun

在 2012-3-2,上午10:11, Andreas Adelmann 写道:

Here a naive question: why do we need a ccollimator at all?

If we are in a Cyclotron we simply specify (more)  attributes such as radii and azimuthal positions. 

With this we avoid an inflation of elements !

Thoughts about this !??

AA




On Mar 2, 2012, at 9:59 AM, jjyang wrote:

Hi Yuanjie,

I tried to call this  function this morning, it does not work.

When I read the code in  Collimator::apply ( as following in blue), it seems designed for   ecollimator, not ccollimator, 
I did not see it use any parameters of  ccollimator, like anglestart, angleend, rstart, rend.

I think we need to do some coding for ccollimator before we can use it.

What is your thought on this?

Jianjun

bool Collimator::apply(const int &i, const double &t, Vector_t &E, Vector_t &B) {
    const Vector_t &R = RefPartBunch_m->R[i] - Vector_t(dx_m, dy_m, ds_m); // including the missaligment
    const Vector_t &P = RefPartBunch_m->P[i];
    const double recpgamma = Physics::c * RefPartBunch_m->getdT() / sqrt(1.0  + dot(P, P));

    /**
    check if we are in the longitudinal
    range of the collimator
    */

    const double z = R(2) + P(2) * recpgamma;

    // particle is not dead
    bool pdead = false;

    if((z > position_m) && (z <= position_m + getElementLength())) {
        if(isAPepperPot_m) {

            /**
               ------------
               |(0)|  |(0)|
               ----   -----
               |    a)    |
               |          |
               ----   -----
               |(0)|  |(0)|
               yL------------
               xL
               |---| d
               |--| pitch
               Observation: the area in a) is much larger than the
               area(s) (0). In a) particles are lost in (0)
               particles they are not lost.

            */
            const double h  =   pitch_m;
            const double xL = - 0.5 * h * (nHolesX_m - 1);
            const double yL = - 0.5 * h * (nHolesY_m - 1);
            bool alive = false;

            for(int m = 0; (m < nHolesX_m && (!alive)); m++) {
                for(int n = 0; (n < nHolesY_m && (!alive)); n++) {
                    double x_m = xL  + (m * h);
                    double y_m = yL  + (n * h);
                    /** are we in a) ? */
                    double rr = std::pow((R(0) - x_m) / rHole_m, 2) + std::pow((R(1) - y_m) / rHole_m, 2);
                    alive = (rr < 1.0);
                }
            }
            pdead = !alive;
        } else if(isASlit_m) {
            //      if ( (abs(R(0) >= getXsize()) || (abs(R(1) >= getYsize()))))
            if(R(0) <= -getXsize() || R(1) <= -getYsize() || R(0) >= getXsize() || R(1) >= getYsize())
                pdead = true;
        } else {
            // case of an elliptic collimator
        }


        if(pdead) {
            double frac = (R(2) - position_m) / P(2) * recpgamma;
            PosX_m.push_back(R(0));
            PosY_m.push_back(R(1));
            PosZ_m.push_back(z);
            MomentumX_m.push_back(P(0));
            MomentumY_m.push_back(P(1));
            MomentumZ_m.push_back(P(2));
            time_m.push_back(t + frac * RefPartBunch_m->getdT());
            id_m.push_back(i);
        }
    }
    return pdead;
}

在 2012-3-2,上午9:44, Andreas Adelmann 写道:

That is exactly how I remember too!
AA
On Mar 2, 2012, at 3:10 AM, Yuanjie Bi wrote:

Hi Jianjun and Jeroen,

Without any surfacephysics, you can use the function Collimator::apply
in Collimator.cpp to remove particles hitting on the collimator. It
checks the shape the of collimator and then removes partilces on it.

Best wishes
Yuanjie

2012/3/1, jjyang <jianjun.yang AT psi.ch>:
Hi Jeroen, I am not sure whether the ccollimator can work without
surfacephysics.

Hi Yuanjie,  will the particle just be deleted when it hits the collimator
if no surfacephysics is specified to it ?

Cheers,

Jianjun

在 2012-3-1,下午2:34, Veenendaal Jeroen 写道:

Dear Yang Jianjun,

I am trying to put a collimator in it without any surfacephysics.
Andreas told me that without this the particle will stop when it hits the
collimator. To test this I made a collimator with aperture of 0.

But the particles do not stop.The particles still continu but the number
of turns they need to go to 250 MeV is higher than without the collimator.

So my question is:
Is the particle slow down and than accelerated again? Or is there
something else?

Thank you

Gr
Jeroen Veenendaal




------
Dr. sc. math. Andreas (Andy) Adelmann
Staff Scientist
Paul Scherrer Institut WLGB/132 CH-5232 Villigen PSI
Phone Office: xx41 56 310 42 33 Fax: xx41 56 310 31 91
Phone Home: xx41 62 891 91 44
-------------------------------------------------------
Thursdays: ETH CAB H 83.1  +41 44 632 36 72
============================================
The more exotic, the more abstract the knowledge, 
the more profound will be its consequences.
Leon Lederman 
============================================





------
Dr. sc. math. Andreas (Andy) Adelmann
Staff Scientist
Paul Scherrer Institut WLGB/132 CH-5232 Villigen PSI
Phone Office: xx41 56 310 42 33 Fax: xx41 56 310 31 91
Phone Home: xx41 62 891 91 44
-------------------------------------------------------
Thursdays: ETH CAB H 83.1  +41 44 632 36 72
============================================
The more exotic, the more abstract the knowledge, 
the more profound will be its consequences.
Leon Lederman 
============================================





------
Dr. sc. math. Andreas (Andy) Adelmann
Staff Scientist
Paul Scherrer Institut WLGB/132 CH-5232 Villigen PSI
Phone Office: xx41 56 310 42 33 Fax: xx41 56 310 31 91
Phone Home: xx41 62 891 91 44
-------------------------------------------------------
Thursdays: ETH CAB H 83.1  +41 44 632 36 72
============================================
The more exotic, the more abstract the knowledge, 
the more profound will be its consequences.
Leon Lederman 
============================================






Archive powered by MHonArc 2.6.19.

Top of Page